feat: 添加filterTreeSelectNode、filterSelectNode函数

This commit is contained in:
xieyonghong 2023-01-16 15:13:43 +08:00
parent 7c349ee6a8
commit b54d1082ca
1 changed files with 21 additions and 1 deletions

View File

@ -35,4 +35,24 @@ export const LocalStore = {
export const getToken = () => {
return LocalStore.get(TOKEN_KEY)
}
}
/**
* TreeSelect过滤
* @param value
* @param treeNode
* @param key
*/
export const filterTreeSelectNode = (value: string, treeNode: any, key: string = 'name'): boolean => {
return treeNode[key]?.includes(value)
}
/**
* Select过滤
* @param value
* @param option
* @param key
*/
export const filterSelectNode = (value: string, option: any, key: string = 'label'): boolean => {
return option[key]?.includes(value)
}