有时候你的上级就会这样恶心你,******,还好有解决办法
created() {
//获取当前页面宽度
const width = window.innerWidth
this.tableWidth = width - 1210
this.formWidth = this.tableWidth - 300
},
computed: {
styleForm() {
return {
'width': this.formWidth + 'px',
'margin': '0 auto',
// 'background-color': 'red',
'display': 'flex',
'flex-wrap': 'wrap',
'justify-content':'space-between'
// '--box-height': this.height + 'px'
}
}
},
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm" :style="styleForm"
label-width="140px">
另外一提,如果你的显示器是2k分辨率,实际开发浏览器时会有很多问题,跟屏幕缩放有关