因為使用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) })