【element-ui】el-dialog改变宽度
dialog默认宽度为父元素的50%,这就导致在移动端会非常的窄,需要自定义custom-class属性,然后编写其样式
·
dialog默认宽度为父元素的50%,这就导致在移动端会非常的窄,如图1,需要限定宽度。
解决方法:添加custom-class
属性,然后在style中编写样式,注意,如果有scoped
限定,需要加::v-deep
<el-dialog
title="XXXX"
:visible.sync="dialogVisible"
custom-class="dialogwidth">
</el-dialog>
<style scoped lang="scss">
::v-deep .dialogwidth{
min-width: 300px;
}
</style>
更多推荐
已为社区贡献3条内容
所有评论(0)