修改store/collapse/index.ts后发现, Menu.vue,MenuLogo.vue,Collapse.vue三个文件对应功能出现bug 将这三个文件中的getCollapse方法直接改为collapse (store/collapse/index.ts修改后collapse为ref值可直接获取) 创建api和compositions模块,抽离表格相关的业务 在api模块下定义列表查询数据类型 在compositions模块下传递参数,并将列表查询的方法返回出去(封装方法) 在views/user/Index.vue文件中从ELement-plus中导入el-main(主要区域容器) 导入useUserTable,获取表格相关业务 通过el-form搭建搜索栏pull/28/head
parent
3b21e3e129
commit
0ff2c7b98b
@ -0,0 +1,7 @@
|
||||
// 定义列表查询的数据类型
|
||||
export type ListUserParm = {
|
||||
currentPage: number;
|
||||
pageSize: number;
|
||||
name: string;
|
||||
phone: string;
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
// 抽离表格相关业务
|
||||
|
||||
import type { ListUserParm } from "../../api/user/userModel";
|
||||
import { reactive } from "vue";
|
||||
|
||||
export default function useUserTable(){
|
||||
// 列表查询的参数
|
||||
const listParm = reactive<ListUserParm>({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
name: '',
|
||||
phone: ''
|
||||
|
||||
})
|
||||
|
||||
// 将表格查询的方法返回出去
|
||||
return{
|
||||
listParm
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue