vue-element-plus-admin
vue-element-plus-admin copied to clipboard
`useTable` 泛型参数支持
希望能给 useTable
增加泛型,用于支持 list
, row
等参数
类似下面的示例
interface UseTableConfig<T = any> {
immediate?: boolean
fetchDataApi: () => Promise<{
list: T[]
total?: number
}>
fetchDelApi?: () => Promise<boolean>
}
export const useTable = <T = any>(config: UseTableConfig<T>) => {
//...
}