What is the difference between vm.$set and Vue.set?

Here is the release note that went with the introduction of Vue.set:

Vue no longer extends Object.prototype with $set and $delete methods.
This has been causing issues with libraries that rely on these
properties in certain condition checks (e.g. minimongo in Meteor).
Instead of object.$set(key, value) and object.$delete(key), use the
new global methods Vue.set(object, key, value) and Vue.delete(object,
key).

So, .$set used to be available on all objects – it is now only available on a View Model itself. Vue.set is therefore used in those cases now when you have a reference to a reactive object but do not have a reference to the View Model it belongs to.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)