mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-19 12:04:02 +08:00
Improve Tree:
1. Add props: renderContent, highlightCurrent 2. Fix Bug: tree do not change when data changed
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<div class="el-tree">
|
||||
<el-tree-node v-for="child in tree.root.children" :node="child"></el-tree-node>
|
||||
<div class="el-tree" :class="{ 'el-tree--highlight-current': highlightCurrent }">
|
||||
<el-tree-node
|
||||
v-for="child in tree.root.childNodes"
|
||||
:node="child"
|
||||
:props="props"
|
||||
:render-content="renderContent">
|
||||
</el-tree-node>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -14,6 +19,7 @@
|
||||
data: {
|
||||
type: Array
|
||||
},
|
||||
renderContent: Function,
|
||||
showCheckbox: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
@@ -31,6 +37,7 @@
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
highlightCurrent: Boolean,
|
||||
load: {
|
||||
type: Function
|
||||
}
|
||||
@@ -49,7 +56,8 @@
|
||||
|
||||
data() {
|
||||
return {
|
||||
tree: {}
|
||||
tree: {},
|
||||
currentNode: null
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user