mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-12 11:55:26 +08:00
18 lines
435 B
TypeScript
18 lines
435 B
TypeScript
export const groupKeysMap = (keys: string[]) => {
|
|
const map = new Map<string, number>();
|
|
keys.forEach((key, index) => {
|
|
map.set(key, index);
|
|
});
|
|
return map;
|
|
};
|
|
|
|
export const groupDisabledKeysMap = <RecordType extends any[]>(dataSource: RecordType) => {
|
|
const map = new Map<string, number>();
|
|
dataSource.forEach(({ disabled, key }, index) => {
|
|
if (disabled) {
|
|
map.set(key, index);
|
|
}
|
|
});
|
|
return map;
|
|
};
|