点击全局取消显示

mounted() {
let _this = this
document.addEventListener("click", function(e) {
if (e.target.className != "点击的类名") {
_this.$nextTick(() => {

//被点击绑定的变量
_this.show= false;
})
}
});
},

posted @ 2023-05-25 14:24  爱吃变态辣  阅读(45)  评论(0)    收藏  举报