赞
踩
1.html
<el-form ref="ruleForm" :model="ruleForm" size="mini" :rules="rules"> <el-table-column align="center" label="姓名" prop="RCNAME"> <template scope="scope"> <el-form-item :rules="rules.RCNAME" :prop="'region.'+scope.$index+'.RCNAME'"> <el-input placeholder="请输入姓名" clearable v-model="scope.row.RCNAME" /> </el-form-item> </template> </el-table-column> </el-form> <el-table-column align="center" label="操作" min-width="120"> <template slot-scope="scope"> <el-button type="text" size="small" @click="delList(ruleForm.region,scope.$index)"> 删除 </el-button> </template> </el-table-column>
2.js
ruleForm: {
region: [{
RCNAME: ''
]
},
delList(row, index) {
row.splice(index, 1)
},
addList(region) {
region.push(Object.assign({}, {
RCNAME: ''
}))
},
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。