computed: {
// (滚动区高度:iframe图片响应式适配)
scrollerHeight: function() {
return (window.innerHeight - 80) + ‘px’;
}
},
mounted() {
this.$nextTick(() => {
let h = this.$refs.main.offsetHeight;
let h_btngroup = this.$refs.btngroup.offsetHeight;
let h_main = h - 40 - h_btngroup;
this.style_form =
"height:" + h_main + "px;overflow-y:auto;overflow-x:hidden;";
});
},
本文探讨了Vue.js中实现响应式布局的方法,特别是在iframe图片适配及组件高度自适应方面的实践。通过计算属性动态调整滚动区高度,确保了在不同屏幕尺寸下页面元素的一致性和用户体验。

417

被折叠的 条评论
为什么被折叠?



