vue中更改背景图高度
html
<div class="login" :style="note">
<div class="loginOne" :style="loginHe">
</div>
</div>
js
data(){
return{
note:{
backgroundImage:'url('+require('@/assets/bk.png')+')',
backgroundRepeat:"no-repeat",
background-size:"100% 100%",margin-top:'20px'
}
}
}
created(){
this.loginHe = 'height:'+($(window).height())+'px;overflow-y:auto;';
}
css
.login{
background-repeat:no-repeat;
background-size:100% 100%
}