1. 添加样式绑定
<div class="container" :style="{height: scrollerHeight}">
</div>
2. 添加属性计算
computed: {
// 滚动区高度
scrollerHeight: function() {
return (window.innerHeight - 50) + 'px'; //自定义高度需求
}
}
<div class="container" :style="{height: scrollerHeight}">
</div>
computed: {
// 滚动区高度
scrollerHeight: function() {
return (window.innerHeight - 50) + 'px'; //自定义高度需求
}
}
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。