You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

64 lines
999 B

<script setup lang="ts">
/**
* 页面主入口
*/
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { columns } from './data';
import { {{entity}}Api } from '#/api/{{entity}}';
const [Grid, gridApi] = useVbenVxeGrid({
columns,
proxyConfig: {
ajax: {
query: async ({ page }) => {
const res = await {{entity}}Api.page({
pageNum: page.currentPage,
pageSize: page.pageSize,
})
const data = res.data
const result = {
items: data.records,
total: data.total
}
console.log('=== 返回给 VxeTable 的数据 ===', result)
return result
}
}
},
pagerConfig: {
enabled: true,
},
}
const [Grid, gridApi] = useVbenVxeGrid({
gridOptions,
})
</script>
<template>
<div>
<Grid table-title="用户列表">
<template #toolbar-tools>
<button @click="() => gridApi.reload()">刷新</button>
</template>
</Grid>
</div>
</template>