element中el-tree组件current-node-key高亮问题


因为使用jsx的写法

<el-tree ref="myTree" data={this.tagtree}
props={this.defaultProps}
on-node-click={this.handleNodeClick}
current-node-key={this.currentNodeKey}
highlight-current={true}
node-key="id">el-tree>

在js中使用

this.$nextTick(() => {})

配合写

this.$nextTick(() => {
        this.$refs['myTree'].setCurrentKey(this.currentNodeKey)
     })