我正在做form validation。我想制定一个简单的规则来检查字段是否完成。但是我不明白如何为多个输入字段接受一条规则。
这是我的代码https://jsfiddle.net/b9q3gx8n/1/
<el-form :model="ruleForm" :inline="true" :rules="rules" ref="ruleForm" >
<el-form-item label="№" prop="mycheck">
<el-input v-model="ruleForm.xxx"></el-input>
{{ruleForm.petition_number}}
</el-form-item>
<el-form-item label="№" prop="mycheck">
<el-input v-model="ruleForm.yyy" border>Ходатайство ДСП</el-input>
{{ruleForm.DSP_attribute}}
</el-form-item>
</el-form>
我的检查规则:
rules: {
mycheck: [
{ required: true, message: 'Please input required', trigger: 'blur' },
{ min: 1, trigger: 'blur' }
],
}