Skip to content
Permalink
Browse files
Tree: fix defaultCheckedKeys and emptyText bug (#11971)
  • Loading branch information
ziyoung committed Jul 12, 2018
1 parent 5e32b4c commit b18642f716aedae9e8de409b64c078bf510ba264
Showing 1 changed file with 6 additions and 2 deletions.
@@ -18,7 +18,7 @@
:render-content="renderContent"
@node-expand="handleNodeExpand">
</el-tree-node>
<div class="el-tree__empty-block" v-if="!root.childNodes || root.childNodes.length === 0">
<div class="el-tree__empty-block" v-if="isEmpty">
<span class="el-tree__empty-text">{{ emptyText }}</span>
</div>
<div
@@ -141,12 +141,16 @@
treeItemArray() {
return Array.prototype.slice.call(this.treeItems);
},
isEmpty() {
const { childNodes } = this.root;
return !childNodes || childNodes.length === 0 || childNodes.every(({visible}) => !visible);
}
},
watch: {
defaultCheckedKeys(newVal) {
this.store.defaultCheckedKeys = newVal;
this.store.setDefaultCheckedKey(newVal);
},

0 comments on commit b18642f

Please sign in to comment.