- el-table-column 表格使用v-show不生效,在使用v-if时加入:key=Math.random()以防止列乱序
仅为带有v-if的列加上:key可能依旧不能解决问题,可以尝试为所有列均加上:key
<el-table-column
align="right"
width="80"
:key=Math.random()
v-if="isOpen"
>
</el-table-column>
- el-input 限制只能输入整数并且限制2位
<el-input
type="number"
placeholder="0"
oninput="if(value.length > 2) value = value.slice(0,2)"
/>%
- 解决浏览器缩放element组件table表格表头错位问题
(放到全局样式中,局部不生效)
.el-table--border th.gutter:last-of-type {
display: block!important;
}
- Dialog对话框弹出后,兼容ios禁止底部页面滑动
// 禁止滑动的div添加 ref="staffSelfuseAdmin"
// 监听 el-dialog对话框 :visible.sync="centerDialogVisible" centerDialogVisible的状态
watch:{
centerDialogVisible(val){
if (val === true) {
this.$refs.staffSelfuseAdmin.style.overflow = "hidden";
this.$refs.staffSelfuseAdmin.style.position = "fixed";
} else {
this.$refs.staffSelfuseAdmin.style.overflow = "auto";
this.$refs.staffSelfuseAdmin.style.position = "absolute";
}
}
},