mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-18 07:16:46 +08:00
--fix bug
This commit is contained in:
@@ -29,6 +29,10 @@ const props = defineProps({
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
pageKey: {
|
||||
type: String,
|
||||
default: "pageNo"
|
||||
},
|
||||
params: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
@@ -45,7 +49,7 @@ const props = defineProps({
|
||||
const emit = defineEmits(["update:params", "update:selectedRowKeys", "update:selectedRows"]);
|
||||
const rowSelectKeys = ref([]);
|
||||
const selectsData = ref([]);
|
||||
const params = useResetRef({ pageNo: 1, pageSize: 10 });
|
||||
const params = useResetRef({ [props.pageKey]: 1, pageSize: 10 });
|
||||
const postParam = computed(() => ({ ...params.value, ...props.params }));
|
||||
|
||||
const { data, loading, total, fetch: onFetch } = props.request(props.url, postParam);
|
||||
@@ -89,12 +93,12 @@ function onSelectChange(e, l) {
|
||||
const pagination = computed(() => ({
|
||||
total: total.value,
|
||||
showSizeChanger: false,
|
||||
current: params.value.pageNo,
|
||||
current: params.value[props.pageKey],
|
||||
pageSize: params.value.pageSize,
|
||||
onChange: changePagination,
|
||||
}));
|
||||
const changePagination = (e) => {
|
||||
params.value.pageNo = e;
|
||||
params.value[props.pageKey] = e;
|
||||
onFetch();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user