vue+element table表格校验必填项
<el-form :model="inServForm" ref="inServForm":rules="rules" size="small"><el-table ref="infiledList" border :data="inServForm.infiledList" style="width: 100%" ><el-table-column prop="ma
·
<el-form :model="inServForm" ref="inServForm" :rules="rules" size="small">
<el-table ref="infiledList" border :data="inServForm.infiledList" style="width: 100%" >
<el-table-column prop="matnrid" label="阈值" width="165px">
<template scope="scope">
<el-form-item :prop="'infiledList.'+scope.$index+'.threshold'" :rules="rules.matnrid">
<el-input size="mini" v-model="scope.row.threshold" ></el-input>
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
export default {
data() {
return {
inServForm: {
infiledList:[],
},
},
computed: {
rules(){
return {
threshold: [{
required: true,
message: "阈值不能为空",
trigger: "blur"
}]
}
}
}
}
}
更多推荐
所有评论(0)