給最外層div遮罩層注冊一個隱藏的事件,里面的內容和元素沒有注冊任何事件,但是點擊里面內容和元素時候會自動冒泡到最外層div的,然后關閉彈窗的,這是為什么,遮罩層設置了fixed; methods: {
modalSwitch: function(event) { this.modal.show = !this.modal.show;
},
setType: function(type) { this.modal.type = type this.modalSwitch();
}
}
vue自動冒泡問題
MYYA
2018-10-11 17:18:41