setPageH() {
const h = document.body.clientWidth;
if (h < 768) {
this.isCollapse = true;
}else{
this.isCollapse = false
}
},
mounted() {
let _this = this;
_this.setPageH();
window.onresize = () => {
return (() => {
_this.setPageH();
})();
};
},
Vue监听浏览器宽度
最新推荐文章于 2024-08-06 17:44:12 发布