problem description
when passing a value to a subcomponent, if the hierarchical relationship is complex, how can you write it grammatically to avoid reporting an error?
as in the following code, when initializing a component, the default value is empty, so an error will be reported.
of course, these variables can still be passed correctly to the subcomponent after getting the value, but I still want to eliminate the error warning.
related codes
<children :data.sync="data.arr[activeArr[0]]" />
...
data() {
return {
activeArr: [],
data: {arr: []}
}
}
error message actually seen