写这个是因为在这上面耗了几十分钟,基本是查阅反复研读element官方文档,最后,结果始终未出来,于是找万能的百度,果然,百度又一次成功地只用30秒就解决了我的问题。答案如下:
<el-tree
v-loading="loading_tree"
ref="tree"
:data="orgData"
:props="defaultProps"
:check-strictly="true"
:expand-on-click-node="false"
node-key="id" //这行不能少
default-expand-all
highlight-current //这行不能少
@node-click="orgClickHandle"
>
this.$nextTick(function() { //这行不能少,我是在created里调用此行,此时el-tree
//未挂载,所以等待挂载完成再进行下面这行代码
this.$refs.tree.setCurrentKey(this.orgData[0].id) //这行是显示要高亮的代码
})