|
|
|
@ -1,6 +1,6 @@ |
|
|
|
import type { PaginationProps } from '../types/pagination'; |
|
|
|
import type { BasicTableProps } from '../types/table'; |
|
|
|
import { computed, unref, ref, ComputedRef } from 'vue'; |
|
|
|
import { computed, unref, ref, ComputedRef, watchEffect } from 'vue'; |
|
|
|
import { LeftOutlined, RightOutlined } from '@ant-design/icons-vue'; |
|
|
|
import { isBoolean } from '/@/utils/is'; |
|
|
|
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '../const'; |
|
|
|
@ -27,6 +27,16 @@ export function usePagination(refProps: ComputedRef<BasicTableProps>) { |
|
|
|
const configRef = ref<PaginationProps>({}); |
|
|
|
const show = ref(true); |
|
|
|
|
|
|
|
watchEffect(() => { |
|
|
|
const { pagination } = unref(refProps); |
|
|
|
if (!isBoolean(pagination) && pagination) { |
|
|
|
configRef.value = { |
|
|
|
...unref(configRef), |
|
|
|
...(pagination ?? {}), |
|
|
|
}; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
const getPaginationInfo = computed((): PaginationProps | boolean => { |
|
|
|
const { pagination } = unref(refProps); |
|
|
|
|
|
|
|
|