|
|
@ -1,6 +1,6 @@ |
|
|
import type { BasicColumn, BasicTableProps, CellFormat, GetColumnsParams } from '../types/table'; |
|
|
import type { BasicColumn, BasicTableProps, CellFormat, GetColumnsParams } from '../types/table'; |
|
|
import type { PaginationProps } from '../types/pagination'; |
|
|
import type { PaginationProps } from '../types/pagination'; |
|
|
import { unref, ComputedRef, Ref, computed, watchEffect, ref, toRaw } from 'vue'; |
|
|
import { unref, ComputedRef, Ref, computed, watch, ref, toRaw } from 'vue'; |
|
|
import { isBoolean, isArray, isString, isObject } from '/@/utils/is'; |
|
|
import { isBoolean, isArray, isString, isObject } from '/@/utils/is'; |
|
|
import { DEFAULT_ALIGN, PAGE_SIZE, INDEX_COLUMN_FLAG, ACTION_COLUMN_FLAG } from '../const'; |
|
|
import { DEFAULT_ALIGN, PAGE_SIZE, INDEX_COLUMN_FLAG, ACTION_COLUMN_FLAG } from '../const'; |
|
|
import { useI18n } from '/@/hooks/web/useI18n'; |
|
|
import { useI18n } from '/@/hooks/web/useI18n'; |
|
|
@ -156,11 +156,22 @@ export function useColumns( |
|
|
return viewColumns; |
|
|
return viewColumns; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
watchEffect(() => { |
|
|
watch( |
|
|
const columns = toRaw(unref(propsRef).columns); |
|
|
() => unref(propsRef).columns, |
|
|
columnsRef.value = columns; |
|
|
(columns) => { |
|
|
cacheColumns = columns?.filter((item) => !item.flag) ?? []; |
|
|
columnsRef.value = columns; |
|
|
}); |
|
|
cacheColumns = columns?.filter((item) => !item.flag) ?? []; |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// watchEffect(() => {
|
|
|
|
|
|
// const columns = toRaw(unref(propsRef).columns);
|
|
|
|
|
|
// console.log('======================');
|
|
|
|
|
|
// console.log(111);
|
|
|
|
|
|
// console.log('======================');
|
|
|
|
|
|
// columnsRef.value = columns;
|
|
|
|
|
|
// cacheColumns = columns?.filter((item) => !item.flag) ?? [];
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* set columns |
|
|
* set columns |
|
|
|