更多關於修改ElementUI樣式的方法,可以參考這篇文章
1.刪除style標簽中的 scoped
屬性
<style lang="lang" scoped>
...
</style>
2.在對應el-form-item的label屬性中加入class樣式
<el-form-item label="用戶名" class="item">
<el-input v-model="ruleForm.username" placeholder="請輸入用戶名" maxlength="10"></el-input>
</el-form-item>
3.審查元素,找到label對應的class
如:.el-form-item__label
添加如下樣式代碼
.item .el-form-item__label{
color: wheat;
}
參考文章:https://blog.csdn.net/qq_40209717/article/details/103413486