I see that when my project loads this function belonging to vue-class-component gets called
function collectDataFromConstructor(vm, Component) {}
vm is a VueComponent instance.
On the other hand when I try to reset component to initial state with this.$options.data() the function collectDataFromConstructor is executed with vm argument of different type. Instead of being a VueComponent instance it is VueComponent.$options. And the collectDataFromConstructor function cannot handle this.
When it arrives here
if (vm.$options.props) {}
It cannot read vm.$options.props because vm is not a component instance, it's already $options part.
The line that provokes problem:
I see that when my project loads this function belonging to vue-class-component gets called
vm
is a VueComponent instance.On the other hand when I try to reset component to initial state with
this.$options.data()
the functioncollectDataFromConstructor
is executed withvm
argument of different type. Instead of being a VueComponent instance it is VueComponent.$options. And thecollectDataFromConstructor
function cannot handle this.When it arrives here
It cannot read
vm.$options.props
becausevm
is not a component instance, it's already $options part.