vue监听全局点击事件以及解绑
methods: {clickOther: function () {};}mounted() {window.addEventListener("click", this.clickOther);}beforeDestroy() {// 实例销毁之前对点击事件进行解绑window.removeEventListener('click', this....
·
methods: {
clickOther: function () {};
}
mounted() {
window.addEventListener("click", this.clickOther);
}
beforeDestroy() { // 实例销毁之前对点击事件进行解绑
window.removeEventListener('click', this.clickOther);
}
更多推荐
已为社区贡献16条内容
所有评论(0)