Solve the error of clearing data in object.assign in Vue

If you want to clear the data in Vue, the error may be the reason why you haven’t changed the direction of this. You can try to change the direction of this with call, for example

   Object.assign(this.$data,   this.$options.data.call(this))

If you just want to know one of the data, you can use it

this.xxx=this.$options.data.call(this).xxxx

Read More: