resizeHandler: function() {if (this.timer) clearTimeout(this.timer);this.timer = setTimeout(() => {this.setWid();this.isShow();}, 500);},
添加监听事件
mounted() {window.onresize = () => {this.resizeHandler();};
}
移除监听事件
beforeDestroy() {window.onresize = null;}