vue js弹窗功能实现

时间:2020-12-27 15:42:08   收藏:0   阅读:30

在点击完之后点击其他位置跳转路由,路由跳转后利用computed属性监听$route进行class的显示和隐藏,利用的是js Contains方法

document.addEventListener(‘mouseup‘,(e)=>{
   var _con = document.getElementById(‘children-view‘)
   if(_con && !_con.contains(e.target){
       this.$route.push({
           name:"Index"
       })     
   }  
})

技术分享图片

 

 

  

原文:https://www.cnblogs.com/gengzhen/p/14196650.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!