天天看點

實作點選頁面其他部分隐藏指定div

實作點選其他部分隐藏某個div

一、在點選展示的元素上設定@click.stop=""

<div class="proTitle" @click.stop="showModel()" style="width:250px; overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display: flex;align-items: center;">
       <span type="text" class="" id="name"  style="font-family:Microsoft YaHei;font-size:20px;color:#353535;font-weight:bold" >{{name}}</span>
         <div class="rightLabel" style="display: flex;align-items: center;margin-left:10px"  ><i class="awsui-iconfont" style="font-size:12px">&#xe716;</i></div>
    </div>
           

二、mounted中設定點選事件

$(document).off("click").on("click",(event)=>{
        this.showFlowLib=false
      })
           

三、methods中設定方法

showModel(){
        this.showFlowLib = true
    },
           

繼續閱讀