feat(projects): useTable adds expand to display
This commit is contained in:
parent
60f3b14085
commit
0a90dd3764
@ -20,6 +20,8 @@ export function useTable<A extends NaiveUI.TableApiFn>(config: NaiveUI.NaiveTabl
|
|||||||
|
|
||||||
const SELECTION_KEY = '__selection__';
|
const SELECTION_KEY = '__selection__';
|
||||||
|
|
||||||
|
const EXPAND_KEY = '__expand__';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
loading,
|
loading,
|
||||||
empty,
|
empty,
|
||||||
@ -68,6 +70,12 @@ export function useTable<A extends NaiveUI.TableApiFn>(config: NaiveUI.NaiveTabl
|
|||||||
title: $t('common.check'),
|
title: $t('common.check'),
|
||||||
checked: true
|
checked: true
|
||||||
});
|
});
|
||||||
|
} else if (column.type === 'expand') {
|
||||||
|
checks.push({
|
||||||
|
key: EXPAND_KEY,
|
||||||
|
title: $t('common.expandColumn'),
|
||||||
|
checked: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -81,6 +89,8 @@ export function useTable<A extends NaiveUI.TableApiFn>(config: NaiveUI.NaiveTabl
|
|||||||
columnMap.set(column.key as string, column);
|
columnMap.set(column.key as string, column);
|
||||||
} else if (column.type === 'selection') {
|
} else if (column.type === 'selection') {
|
||||||
columnMap.set(SELECTION_KEY, column);
|
columnMap.set(SELECTION_KEY, column);
|
||||||
|
} else if (column.type === 'expand') {
|
||||||
|
columnMap.set(EXPAND_KEY, column);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ const local: App.I18n.Schema = {
|
|||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
close: 'Close',
|
close: 'Close',
|
||||||
check: 'Check',
|
check: 'Check',
|
||||||
|
expandColumn: 'Expand Column',
|
||||||
columnSetting: 'Column Setting',
|
columnSetting: 'Column Setting',
|
||||||
config: 'Config',
|
config: 'Config',
|
||||||
confirm: 'Confirm',
|
confirm: 'Confirm',
|
||||||
|
@ -11,6 +11,7 @@ const local: App.I18n.Schema = {
|
|||||||
cancel: '取消',
|
cancel: '取消',
|
||||||
close: '关闭',
|
close: '关闭',
|
||||||
check: '勾选',
|
check: '勾选',
|
||||||
|
expandColumn: '展开列',
|
||||||
columnSetting: '列设置',
|
columnSetting: '列设置',
|
||||||
config: '配置',
|
config: '配置',
|
||||||
confirm: '确认',
|
confirm: '确认',
|
||||||
|
1
src/typings/app.d.ts
vendored
1
src/typings/app.d.ts
vendored
@ -261,6 +261,7 @@ declare namespace App {
|
|||||||
cancel: string;
|
cancel: string;
|
||||||
close: string;
|
close: string;
|
||||||
check: string;
|
check: string;
|
||||||
|
expandColumn: string;
|
||||||
columnSetting: string;
|
columnSetting: string;
|
||||||
config: string;
|
config: string;
|
||||||
confirm: string;
|
confirm: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user