<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 } }