<div style="margin: 10px;">
<el-input v-model="item.name" v-for="item in ruleForm"></el-input>
<el-button @click="submit()">添加</el-button>
{{ruleForm}}
</div>
submit(){
this.ruleForm.push(this.ruleForm[0]);
}
这样写会导致一个结果,两边公用一个数据源
解决方法
this.ruleForm.push(Object.assign({},this.ruleForm[0]));