element ui 封装的组件,在外部使用时可以直接用这个组件名作为class进行样式修改,这个是怎么实现的
给你推荐一篇博文大概了解下(https://www.cnblogs.com/mengfangui/p/9724740.html),想知道更多,最好研究下源码
有两种办法
// templateClass 为自己添加的父元素的类名
.templateClass >>> .el-form-item__content {
width: 82%;
}
不生效时 就在css后面加上 !important
.templateClass >>> .el-form-item__content {
width: 82% !important;
}
// preview 为自己添加的父元素的类名
.preview /deep/ .el-dialog__body {
height: 94% !important;
}