data(){
return {
screenWidth: document.body.clientWidth
}
},
mounted() {
//监听浏览器大小
let that = this;
window.addEventListener("resize", function() {
return (() => {
window.screenWidth = document.body.clientWidth;
that.screenWidth = window.screenWidth;
console.log("that.screenWidth", that.screenWidth);
})();
});
},
watch: {
//防止因为频繁触发 resize 函数,导致页面很卡的问题
screenWidth(val) {
if (!this.timer) {
this.screenWidth = val;
this.timer = true;
let that = this;
setTimeout(function() {
that.reload();
that.timer = false;
}, 400);
}
}
}
悟空浏览器的秘密:如何轻松下载小说和视频?网页版入口大公开!
上面是“vuejs监听当前浏览器大小执行”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_1801.html
workflows工作流
一个闪闪发光的金属球ComfyUI工作流
一只迷人的黑豹ComfyUI工作流
令人着迷的一只老虎ComfyUI工作流
强大的长袍法师ComfyUI工作流
一个迷人而丰满的女巫和一只黑猫骑着飞天扫帚
一只透明老虎骨骼标本ComfyUI工作流
一个破旧的工厂,一个骷髅雕像
一只可爱的快乐老鼠戴着帽子ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

用ascii字符画图像
利用css绘画棋盘布局(象棋)
javascript如何利用draggable实现一个拖拽效果
利用html5+css3实现滚雪球效果(附代码)
利用canvas画几个好玩的星云物种
纯css翻书效果
用canvas实现画板涂鸦效果
数字滚动效果(兼容IE6/IE8)










