The use of Vue.set is Vue.set (app.$data, 'baked, 2). Why do you add $before data?

Vue.set (app.$data, "baked, 2)

app.$data,
Why do you add $before data, and if you don"t add $, you will report an error

Mar.10,2021

app.$data is an instance attribute. You can read the data

in data .
the data object observed by the Vue instance. The Vue instance proxies access to its data object properties.

vue document
ide/instance.html" rel=" nofollow noreferrer "> ide/instance.html" rel= "nofollow noreferrer" > https://cn.vuejs.org/v2/guide.


if you take a separate data object, you don't need to add $; but you take the whole data option of Vue, of course you need to add it. For example:

var app = new Vue({
  data: {
    return {
      a: 10
    }
  }
})

Vue.set(app.$data, 'b', 3) // b
Vue.set(app.a, 'b',3) // ab
// 
Menu