data() {
return {
positive_rule: [
{
positive_rule: "",
},
],
};
},
methods: {
addMore() {
this.positive_rule.push({
positive_rule: "",
});
},
remove(index: any) {
this.positive_rule.splice(index, 1);
},
}
can someone please help me by correcting this code snippet so that the 'addMore' function works cheers!
CodePudding user response:
You probably wanted to write it this way:
methods: {
addMore: () => {
this.positive_rule.push({
positive_rule: "",
});
},
remove: (index: any) => {
this.positive_rule.splice(index, 1);
},
}