feat: 🎸 Table组件重构完成并给出相应示例

This commit is contained in:
chenkl
2020-12-22 17:24:55 +08:00
parent 429e42809c
commit 35879f8ecc
50 changed files with 1056 additions and 449 deletions

View File

@@ -1,6 +1,40 @@
// 常用的增删改查 hook
import { reactive } from 'vue'
import { reactive, ref } from 'vue'
export function() {
interface DefalutParams {
pageIndex: number
pageSize: number
}
export function useExample() {
const defalutParams = reactive<DefalutParams>({
pageIndex: 1,
pageSize: 10
})
const tableData = ref<any[]>([])
const loading = ref<boolean>(true)
const total = ref<number>(0)
function sizeChange(val: number) {
loading.value = true
defalutParams.pageIndex = 1
defalutParams.pageSize = val
}
function currentChange(val: number) {
loading.value = true
defalutParams.pageIndex = val
}
return {
defalutParams,
tableData,
loading,
total,
sizeChange,
currentChange
}
}