如果在非scoped下,修改el-dialog自动添加的DIV类名的style加上important,可以覆盖原来的width,但这样会让整个项目的样式都乱套。
如果在scoped下修改style。所有的自定义样式都无法覆盖element的样式啊,加上important也不行,
<style scoped>
</style>
<el-dialog :title="titleStr" v-model="dialogFormVisible" custom-class = "dialog">
<el-dialog :title="titleStr" v-model="dialogFormVisible" class = "dialog">
重新命名class名,
定义CSS样式
<el-dialog title="新增孩子" v-model="addFormVisible" :close-on-click-modal="false">
<el-form :model="addForm" label-width="85px" :rules="addFormRules" ref="addForm">
<el-form-item label="姓名:" prop="ChildName">
<el-input v-model="addForm.ChildName" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="性别:" prop="Gender">
<el-radio-group v-model="addForm.Gender">
<el-radio class="radio" label="1">男</el-radio>
<el-radio class="radio" label="2">女</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="生日:" prop="Birthday">
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.Birthday"></el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="addFormVisible = false">取 消</el-button>
<el-button type="primary" @click.native="addSubmit" :loading="addLoading">提 交</el-button>
</div>
</el-dialog>