[Vuejs]-Clone element form

1👍

You just have to add an button to your template and define a @click function for it, which adds a new item to your people.phones array.

Template:

<button @click="addNumber">
   add number
</button>

Vue:

methods: {
   addNumber: function(){
      this.people.phones.push({number: "", type: ""});
   }
}

Simplified example: http://jsfiddle.net/wpako31u/

Leave a comment