mirror of
https://github.com/element-plus/element-plus.git
synced 2025-03-01 15:35:51 +08:00
docs: [tree-v2] fix style error and remove annotation (#19681)
This commit is contained in:
parent
7e819b6762
commit
151fadd951
docs
@ -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.
|
||||
|
@ -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) =>
|
||||
|
Loading…
Reference in New Issue
Block a user