0๐
โ
Oh! I have messed up with Object.assign()
. This is a right using of Object.assign()
instead of Vue.set()
:
var button = {};
button[name] = {
component,
options,
};
this.buttons = Object.assign({}, this.buttons, button);
This works fine for me. And documentation is here https://v2.vuejs.org/v2/guide/reactivity.html#For-Objects :
// instead of `Object.assign(this.someObject, { a: 1, b: 2 })` this.someObject = Object.assign({}, this.someObject, { a: 1, b: 2 })
Source:stackexchange.com