问题一:
前端控制台会报错,elementui 组件、方法或属性找不到
Cannot read property 'xxx' of undefined"
Cannot read property 'xxx' of null
this.$refs.tree is undefined
等等
问题分析:
DOM渲染未结束
解决方法:
//$nextTick 是确保DOM渲染结束之后执行的
this.$nextTick(() => {
do some thing...
this.$refs.tree.filter(this.deptName);
});