element Cascader 鼠标移出浮层时自动收起

<el-cascader 
       :style="aotuStyle" 
       ref="elcascader" 
       v-model="discipline_value" 
       :options="discipline_list"
       :key="isResouceShow"
       popper-class="discipline"
       separator=""
       :show-all-levels="isOld"
       :props="{value: 'id',label: 'name',expandTrigger: 'hover'}"
       @change="switchRole"></el-cascader>
created () {
   this.$refs.elcascader.$refs.popper.onmouseleave = function(){
     that.$refs.elcascader.dropDownVisible = false
   }
}
如果
cascader 数据是异步获取的,this.$refs.elcascader可能获取不到,这个时候适当给个延迟函数

posted @ 2020-06-09 16:36  一个懒惰的陈xx  阅读(1424)  评论(0编辑  收藏  举报