<div @click="judge=true">显示</div>
<div v-show="judge" id="box"></div>
created(){
    document.addEventListener("click",e=>{
    let box = document.getElementById("moreBox")
    if(!box.contains(e.target)){
        this.judge = false
    }
}
Logo

前往低代码交流专区

更多推荐