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' },