标签:load spl loaded auto splay this size handle play
data:{
isLeftHiden:false,
},
methods:{
togglemobileauto(ismobile){
this.isLeftHiden = ismobile
},
},
beforeMount () {
const {body} = document
const WIDTH = 768;
const RATIO = 3;
const handler = () => {
if (!document.hidden) {
let rect = body.getBoundingClientRect()
console.log(rect,7777);
let isMobile = rect.width - RATIO < WIDTH
this.togglemobileauto(isMobile)
}
}
document.addEventListener(‘visibilitychange‘, handler)
window.addEventListener(‘DOMContentLoaded‘, handler)
window.addEventListener(‘resize‘, handler);
},
标签:load spl loaded auto splay this size handle play
原文地址:https://www.cnblogs.com/breakXu/p/10191202.html