0👍
The data property of an object represents its internal state and it is kind of weird to try to assign values from outside.
I would suggest to use properties (props). Props are values send from the outside to the component.
If properties doesn’t work for you, then you could make a method in your component, that method will receive your new values and assign those values to internal data. From the outside instead of assigning directly the values, you will call a method to do that.
- [Vuejs]-How to show a component in Vue.js when an API condition has been met?
- [Vuejs]-NodeJS request with range does not work with HTML5 video
0👍
Vue 3 wraps reactive data in proxies. Therefore your data might look like this, with getters and setters.
Try console.log(JSON.stringify(YOUR_ARRAY))
to see if your data is as expected.
You did not provide enough code, to know exactly why your data is undefined
, where you expect it to be available.
Rememeber that props should be accessed using this.$props.PROPNAME
inside a child component.