UNPKG

@pluve/use-antd-table-vue

Version:

ant-design-vue Form 与 Table 联动逻辑封装

23 lines (22 loc) 930 B
import { type ComputedRef } from "vue"; import { IRequest, IOptions, ITableProps, ITableMutateType } from "./types"; import { DebouncedFunc } from "lodash-es"; declare const useAntdTable: <T>(request: IRequest<T>, { defaultCurrent, defaultPageSize, form, onSuccess, throttle, }?: IOptions) => { tableProps: ComputedRef<ITableProps<T>>; search: { submit: (() => Promise<any>) | DebouncedFunc<() => Promise<any>>; reset: (() => Promise<void>) | DebouncedFunc<() => Promise<void>>; }; updateDataItem: ({ key, value, params, }: { key: string; value: any; params: any; }) => void; addDataItem: (dataItem: any) => void; removeDataItem: ({ key, value }: { key: string; value: any; }) => void; mutate: (data?: ITableMutateType | ((oldData?: ITableMutateType) => ITableMutateType | undefined) | undefined) => void; }; export default useAntdTable;