e.g.
<div>{{obj.name}}</div>
<div>{{obj.info.access_control}}</div>
data(){
return {
obj:{}
}
}
The data format of template rendering is obj.name or obj.info.access_ Control, why does obj.name not report the above dislocation and obj.info.access_ The above error will appear in control. Because obj data has not been requested from the back end to assign its value, the obj object is still an empty object. Without the attribute info, obj.info is naturally undefined, and then undefined.access_ Control will naturally report the above error.
Solution: add info null object in obj object
data(){
return {
obj:{
info:{}
}
}
}
Read More:
- [Vue warn]: Error in render: “TypeError: Cannot read properties of undefined
- Vue error in render: “typeerror: cannot read property ‘name’ of undefined”
- [Solved] Error in v-on handler “TypeError Cannot read properties of undefined (reading ‘resetFields‘)“
- Using pop-up window and I18N, error in render: “typeerror: cannot read property” appears_ T ‘of undefined’ solution
- [Solved] vue watch Error: Error in callback for watcher “xxx“: “TypeError: Cannot read properties of undefined …
- [Solved] Element form method Error: TypeError: Cannot read properties of undefined (reading ‘resetFields’)
- [Solved] VUE Error: Error in mounted hook: “TypeError: Cannot read properties of undefined (reading ‘$on‘)“
- Vue form validate error: Error in v-on handler “TypeError Cannot read properties of undefined (reading ‘indexOf‘)
- [Solved] Vue Project Error: “TypeError: Cannot read properties of undefined (reading ‘init‘)“
- [Solved] react Chrome Browser Error: Uncaught TypeError: Cannot read properties of undefined (reading ‘forEach‘)
- [Solved] Element form method resetfields() error: vue.runtime.esm.js?2b0e:1888 TypeError: Cannot read properties of undefined (reading ‘indexOf’)
- Error in nextTick: “TypeError: Cannot set properties of undefined (setting ‘checked‘)“
- uniapp Use render Function Error: [Vue warn]: Error in beforeCreate hook: “TypeError: Cannot read property ‘_i‘ of
- [Solved] Binding onclick event in JS: for loop: error uncaught typeerror: cannot set properties of undefined (setting ‘classname’)
- Cannot read property ‘properties’ of undefined
- [Solved] Echarts Error: TypeError: Cannot read properties of null (reading getAttribute )
- [Solved] Cannot read properties of undefined (reading ‘propsData‘)“
- Error in created hook: “typeerror: cannot read property ‘cm’ of undefined”
- Error in mounted hook: “TypeError: Cannot read property ‘init‘ of undefined“
- Uni-app Error when assigning a value to a component: [system] TypeError: Cannot read property ‘name‘ of undefined