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