feat: 添加filterTreeSelectNode、filterSelectNode函数
This commit is contained in:
parent
7c349ee6a8
commit
b54d1082ca
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue