VueJs 监听 window.resize 方法---窗口变化
mounted() { let _this = this; window.onresize = ()=>{ return (()=>{ this.vscreen.height=document.body.clientHeight+'px' })() } }
给图片设置成屏幕高度:
<div :style="vscreen"></div> data() { return { vscreen: { height: '', } } }, created() { this.vscreen.height=document.body.clientHeight+'px' },
本博客主要记录自己的学习点滴~,文章来源于总结,还有在工作中实际碰到的问题以记录。