vue.js实时监听浏览器界面大小改动的办法
mounted() {let self = this;this.screenWidth = document.body.clientWidth; //767this.screenHeight = document.body.clientHeight;//350window.onresize = () => {return (() =...
·
mounted() { let self = this; this.screenWidth = document.body.clientWidth; //767 this.screenHeight = document.body.clientHeight;//350 window.onresize = () => { return (() => { this.screenWidth = document.body.clientWidth; this.screenHeight = document.body.clientHeight; if(this.screenWidth<=767 & this.screenHeight<=350) { self.seen = true; self.peen = false; $(document).ready(function(){ $(".homeMenu").click(function(){ $(".panel").slideToggle("fast") }); }); }else{ self.seen = false; self.peen = true; } })(); }; }
更多推荐
已为社区贡献3条内容
所有评论(0)