mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-27 02:01:15 +08:00
chore: fix type error of the tree customNodeClass demo (#18920)
chore: fix type error of the tree demo
This commit is contained in:
parent
f180e0c236
commit
23ce3ff8f1
@ -14,7 +14,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type Node from 'element-plus/es/components/tree/src/model/node'
|
||||
|
||||
import type { TreeNodeData } from 'element-plus/es/components/tree/src/tree.type'
|
||||
interface Tree {
|
||||
id: number
|
||||
label: string
|
||||
@ -22,12 +22,8 @@ interface Tree {
|
||||
children?: Tree[]
|
||||
}
|
||||
|
||||
const customNodeClass = (data: Tree, node: Node) => {
|
||||
if (data.isPenultimate) {
|
||||
return 'is-penultimate'
|
||||
}
|
||||
return null
|
||||
}
|
||||
const customNodeClass = ({ isPenultimate }: TreeNodeData, node: Node) =>
|
||||
isPenultimate ? 'is-penultimate' : ''
|
||||
|
||||
const data: Tree[] = [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user