wip: table列设置开发

This commit is contained in:
kailong321200875
2023-07-21 14:42:16 +08:00
parent ecd38282a3
commit 040476fe24
3 changed files with 105 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ import { reactive, unref } from 'vue'
import { ElTag, ElButton } from 'element-plus'
import { useTable } from '@/hooks/web/useTable'
const { tableRegister, tableState } = useTable({
const { tableRegister, tableState, tableMethods } = useTable({
fetchDataApi: async () => {
const { currentPage, pageSize } = tableState
const res = await getTreeTableListApi({
@@ -21,6 +21,7 @@ const { tableRegister, tableState } = useTable({
}
})
const { loading, dataList, total, currentPage, pageSize } = tableState
const { sortableChange } = tableMethods
const { t } = useI18n()
@@ -100,10 +101,12 @@ const actionFn = (data: TableSlotDefault) => {
:data="dataList"
row-key="id"
:loading="loading"
sortable
:pagination="{
total: total
}"
@register="tableRegister"
@sortable-change="sortableChange"
/>
</ContentWrap>
</template>