0👍
modify your code like this:
addComponent() {
this.address_components.push({id:++this.sort})
},
0👍
How about creating a list in your data() and just push a object there.
<ul id="example-1">
<li v-for="item in items">
{{ item.message }}
</li>
</ul>
var example1 = new Vue({
el: '#example-1',
data: {
items: []
},
methods:
{
Add:function()
{
//process the inputs and push it to items list
this.items.push({ message: "Hi"})
}
}
})
Did not tested this and just created from example from Vue Documentation but you got the idea. Pushing a new item in list will automatically updates the component or the element
- [Vuejs]-How to access nested json object property using nuxtjs and v-for
- [Vuejs]-Using Vuex in Vuejs application
Source:stackexchange.com