Commit f2d2dc4d9e0b3bcfec490cdbb3d9c5936c8aed26
1 parent
df8a0768
perf: XTable hooks
Showing
1 changed file
with
3 additions
and
3 deletions
yudao-ui-admin-vue3/src/hooks/web/useXTable.ts
| ... | ... | @@ -8,14 +8,14 @@ export interface tableMethod { |
| 8 | 8 | exportList: (fileName?: string) => void |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | -export function useXTable(props: XTableProps): [Function, tableMethod] { | |
| 11 | +export const useXTable = (props: XTableProps): [Function, tableMethod] => { | |
| 12 | 12 | const tableRef = ref<Nullable<tableMethod>>(null) |
| 13 | 13 | |
| 14 | - function register(instance) { | |
| 14 | + const register = (instance) => { | |
| 15 | 15 | tableRef.value = instance |
| 16 | 16 | props && instance.setProps(props) |
| 17 | 17 | } |
| 18 | - function getInstance(): tableMethod { | |
| 18 | + const getInstance = (): tableMethod => { | |
| 19 | 19 | const table = unref(tableRef) |
| 20 | 20 | if (!table) { |
| 21 | 21 | console.error('表格实例不存在') | ... | ... |