<el-dialog title="" :visible.sync="dialogShow" width="20%" >
<el-form label-position="right" label-width="100px" :model="deptInfo" :rules="rules" ref="deptInfo" >
<el-form-item label=":" prop="name">
<el-input placeholder="" v-model="deptInfo.DeptName"></el-input>
</el-form-item>
<el-form-item label=":">
<el-input type="textarea" v-model="deptInfo.DeptRemark"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="create("deptInfo")"> </el-button>
<el-button @click="dialogShow = false"> </el-button>
</span>
</el-dialog>
rules: {
name: [
{ required: true, message: "", trigger: "blur" },
],
},
this is the layout code and the rules code in data, but when I fill in the data on the page, the button always prompts "Please enter the department name", and the console reports async-validator: ["name is required"]
.
the same updata box can be used normally. I don"t know what"s wrong. I haven"t found it for a long time. Thank you, boss
.