摘要: 前言 Vue中使用$on绑定的事件销毁组件时必须移除 原因 1.导致多余调用监听事件,造成资源浪费 2.导致数据错乱 具体操作 // 移除单个 beforeDestroy(){ this.bus.$off('actName') } // 移除多个 beforeDestroy(){ this.bus. 阅读全文
posted @ 2022-12-21 21:38 轻风细雨_林木木 阅读(57) 评论(0) 推荐(0) 编辑