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,我们会在看到邮件的第一时间内为您处理!

canvas经线动画走到效果
做一个好玩的时钟翻牌效果
3d文字360度旋转
纯css制作卡通头像(随鼠标转头)
3d空间行走效果
一起去看流星雨(代码)
SVG路径动画效果











