<template> <el-form :model='queryForm' ref='queryForm'> <div v-for="(item,index) in queryForm.tags"> <el-form-item :prop="`tags[${index}].name`" :rules='[{required:true,message:"请输入姓名",trigger:"blur"}]'> <el-input v-model="item.name"/> </el-form-item> </div> </el-form> </template> export default { data(){ return { queryForm:{ id:1, tags:[{name:"风里来,雨里去"}] } } } }
标签:form,验证,prop,ui,element,表单 From: https://www.cnblogs.com/jzm2842688813/p/16783719.html