TypeError: Cannot read properties of undefined (reading '0')
at Proxy.render (form1.vue?4692:190:1)
at renderComponentRoot (runtime-core.esm-bundler.js?5c40:893:1)
form1.vue?4692:190 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0')
at Proxy.render (form1.vue?4692:190:1)
at renderComponentRoot (runtime-core.esm-bundler.js?5c40:893:1)
at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js?5c40:5030:1)
at ReactiveEffect.run (reactivity.esm-bundler.js?a1e9:160:1)
Error Occurred
<input
type="text"
class="form-control"
v-model="data['item3'][0].item1"
/>
data to:
item3: [
{
item1: 'SSS',
item2: [{ item3: '2' }],
item3: '',
item4: '2',
item5: '',
item6: '',
item7: '',
item8: '',
item9: '',
item10: '1',
item11: '1',
},
],
vue page data to:
const data = ref<any>({});
onMounted(() => {
data.value = props.modelValue;
if (!data.value['sheetname']) {
data.value = new E507().data;
data.value.sheetname = props.sheet.templatename;
}
console.log(data.value);
});
data['item3'][0] Inaccessible. data['item3']?.[0] I couldn't do v-model in binding.
Is there a way to access the 0th object?
datalooks like?