dialog默認(rèn)寬度為父元素的50%,這就導(dǎo)致在移動(dòng)端會(huì)非常的窄,如圖1,需要限定寬度。
解決方法:添加custom-class
屬性,然后在style中編寫樣式,注意,如果有scoped
限定,需要加::v-deep
文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-675063.html
<el-dialog
title="XXXX"
:visible.sync="dialogVisible"
custom-class="dialogwidth">
</el-dialog>
<style scoped lang="scss">
::v-deep .dialogwidth{
min-width: 300px;
}
</style>
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-675063.html
到了這里,關(guān)于【element-ui】el-dialog改變寬度的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!