修复分页器失效
This commit is contained in:
@@ -83,23 +83,26 @@ export function useTable(config: any) {
|
|||||||
// size: 'f',
|
// size: 'f',
|
||||||
current: 1,
|
current: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
defaultPageSize: 10,
|
||||||
|
responsive: true,
|
||||||
onChange: async (current: number, pageSize: number) => {
|
onChange: async (current: number, pageSize: number) => {
|
||||||
pagination.current = current;
|
pagination.current = current;
|
||||||
|
pagination.pageSize = pageSize;
|
||||||
updateSearchParams({
|
updateSearchParams({
|
||||||
pageNum: current,
|
pageNum: current,
|
||||||
pageSize
|
pageSize
|
||||||
});
|
});
|
||||||
|
|
||||||
getData();
|
getData();
|
||||||
}
|
},
|
||||||
|
showTotal: (total: number) =>
|
||||||
|
$t('common.tablePaginationTotal', { total: total })
|
||||||
});
|
});
|
||||||
|
|
||||||
// this is for mobile, if the system does not support mobile, you can use `pagination` directly
|
// this is for mobile, if the system does not support mobile, you can use `pagination` directly
|
||||||
const mobilePagination = computed(() => {
|
const mobilePagination = computed(() => {
|
||||||
const p: TablePaginationConfig = {
|
const p: TablePaginationConfig = {
|
||||||
...pagination,
|
...pagination,
|
||||||
simple: appStore.isMobile
|
simple: appStore.isMobile
|
||||||
};
|
};
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ const local: any = {
|
|||||||
month: 'Month',
|
month: 'Month',
|
||||||
year: 'Year',
|
year: 'Year',
|
||||||
core: 'Core',
|
core: 'Core',
|
||||||
}
|
},
|
||||||
|
tablePaginationTotal: 'Total {total} items',
|
||||||
},
|
},
|
||||||
// 组件
|
// 组件
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ const local:any = {
|
|||||||
month: '月',
|
month: '月',
|
||||||
year: '年',
|
year: '年',
|
||||||
core: '核',
|
core: '核',
|
||||||
}
|
},
|
||||||
|
tablePaginationTotal: '总共 {total} 条',
|
||||||
},
|
},
|
||||||
// 组件
|
// 组件
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
Reference in New Issue
Block a user