Reputation: 2164
this is my items
object:
items: {
houses:{
name: 'Houses',
url: '/houses',
icon: 'icon-home',
},
users:{
name: 'Users',
url: '/users',
icon: 'icon-people',
},
}
I use vue.set to add item in my items
object:
Vue.set(nav.items, 'agency_home',
{name: 'Agency',
url: '/pages/404',
icon: 'icon-home'}
)
This code works, it adds it after the users
key. However, I want to add it after the the houses
key.
Upvotes: 0
Views: 1005
Reputation: 35674
Instead of set
, you would use the splice
array method, which will invoke the update.
Upvotes: 1