docs: [tree-v2] fix style error and remove annotation ()

This commit is contained in:
jiaxiang 2025-01-18 09:05:25 +08:00 committed by GitHub
parent 7e819b6762
commit 151fadd951
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 10 deletions
docs
en-US/component
examples/tree-v2

View File

@ -67,11 +67,9 @@ tree-v2/custom-node-class
:::
## Tree node filtering
## Tree node filtering ^(2.9.1)
::: ^(2.9.1)
The `filter-method` method can only accept the third parameter after version 2.9.1.
:::
The `filter-method` method can only accept the third parameter after version `2.9.1`.
Tree nodes can be filtered
:::demo Invoke the `filter` method of the Tree instance to filter tree nodes. Its parameter is the filtering keyword. Note that for it to work, `filter-method` is required, and its value is the filtering method.

View File

@ -25,9 +25,7 @@ interface Tree {
children?: Tree[]
}
const getKey = (prefix: string, id: number) => {
return `${prefix}-${id}`
}
const getKey = (prefix: string, id: number) => `${prefix}-${id}`
const createData = (
maxDeep: number,
@ -63,9 +61,6 @@ const props = {
}
const onQueryChanged = (query: string) => {
// TODO: fix typing when refactor tree-v2
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
treeRef.value!.filter(query)
}
const filterMethod = (query: string, node: TreeNodeData) =>