there is a reference example in the documentation in iview
<FormItem v-for="(item, index) in formDynamic.items"
v-if="item.status"
:key="index"
:label=""Item " + item.index"
:prop=""items." + index + ".value""
:rules="{required: true, message: "Item " + item.index +" can not be empty", trigger: "blur"}">
</FormItem>
now implement custom validation in rules
<FormItem v-if="actionLabel!==""&&showActionValType===1"
:label="actionLabelText"
prop="actionValDIM"
:rules="{required: true,validator:"validateInt" , trigger: "blur"}">
<Slider v-model="programForm.actionValDIM" :tip-format="format" style="width: 400px"></Slider>
</FormItem>
how to pass the function validateInt in
it"s like a document in data. It"s written in OK, but I think there"s a problem with uploading it in": rules= "{required: true,validator:"validateInt", trigger: "blur"}"
.ruleCustom: {
passwd: [
{ validator: validatePass, trigger: "blur" }
],
passwdCheck: [
{ validator: validatePassCheck, trigger: "blur" }
],
age: [
{ validator: validateAge, trigger: "blur" }
]
}