From 858b9bccead46cdefc99325b7c956d50a2964309 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期六, 08 三月 2025 10:20:28 +0800 Subject: [PATCH] 一些优化 --- src/components/Table/src/props.ts | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/components/Table/src/props.ts b/src/components/Table/src/props.ts index 888cd9f..ebc05e8 100644 --- a/src/components/Table/src/props.ts +++ b/src/components/Table/src/props.ts @@ -8,11 +8,13 @@ TableCustomRecord, TableRowSelection, SizeType, + BasicTableProps, } from './types/table'; -import type { FormProps } from '/@/components/Form'; +import type { FormProps } from '@/components/Form'; import { DEFAULT_FILTER_FN, DEFAULT_SORT_FN, FETCH_SETTING, DEFAULT_SIZE } from './const'; -import { propTypes } from '/@/utils/propTypes'; +import { propTypes } from '@/utils/propTypes'; +import type { Key } from 'ant-design-vue/lib/table/interface'; export const basicProps = { clickToRowSelect: { type: Boolean, default: true }, @@ -105,6 +107,7 @@ type: Object as PropType<TableRowSelection | null>, default: null, }, + showSelectionBar: propTypes.bool, title: { type: [String, Function] as PropType<string | ((data: Recordable) => string)>, default: null, @@ -118,7 +121,7 @@ default: null, }, rowKey: { - type: [String, Function] as PropType<string | ((record: Recordable) => string)>, + type: [String, Function] as PropType<BasicTableProps['rowKey']>, default: '', }, bordered: propTypes.bool, @@ -131,17 +134,11 @@ type: Function as PropType<(record: TableCustomRecord<any>, index: number) => string>, }, scroll: { - type: Object as PropType<{ x: number | string | true; y: number | string }>, - default: null, + type: Object as PropType<PropType<BasicTableProps['scroll']>>, }, beforeEditSubmit: { type: Function as PropType< - (data: { - record: Recordable; - index: number; - key: string | number; - value: any; - }) => Promise<any> + (data: { record: Recordable; index: number; key: Key; value: any }) => Promise<any> >, }, size: { -- Gitblit v1.9.3