用表单时经常需要校验表单项
正常用法如下:
<el-form-item label="分辨率" prop="resolvingPower">
<el-select v-model="form.resolvingPower" style="float: left; width: 100%">
<el-option
v-for="item in resolvingOption"
:key="item.value"
:label="item.name"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
但有时候校验需要另外处理,表单上需要弄个类似的小红星
<el-form-item prop="applicationAlgorithm1">
<span slot="label">
<span style="color: #F56C6C">* </span>
<span>分辨率</span>
</span>
<el-checkbox-group v-model="form.applicationAlgorithm" :max="4" @change="handleCheckedChange">
<el-checkbox v-for="(item,index) in algorithmArray"
:key="index"
:label="item.id"
>
{{ item.name }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>