Elment plus dialog组件 移动端中使用百分比显示问题(自适应)

直接上方法:CSS加入下面代码

@media screen and (min-width: 220px) and (max-width:600px) {
    ::v-deep .el-dialog {
        width: 90% !important;
    }
}

上面代码意思是:当屏幕宽度小于600px且大于220px的时候el-dialog设置为90%。

如果仅小于或者仅大于,值用其中一个 and 就可以,例如:

@media screen and (max-width:600px) {
    ::v-deep .el-dialog {
        width: 90% !important;
    }
}

你可能感兴趣的:(web前端,vue.js,前端,javascript)