Vue error vue.esm.js?eaf6 :628 [Vue warn]: Error in callback for immediate watcher “height”: “TypeError: Cannot read property ‘style’ of undefined”
TypeError: Cannot read property ‘style’ of undefined
As follows:
The error is because tabledata is an empty array this.monthTradingTableHeight This is empty
solve:
1. Do not render when there is no data, and add a style with no data
code:
effect:
2. Or HTML code unchanged, modify JS, and give it when there is no data this.monthTradingTableHeight If you assign a value or ‘auto’, you will not report an error
code:
this.monthTradingTableHeight = tableData.length > 9 ? '310' : 'auto'
effect:
Here I choose the first solution, which is to add a style with no data.
Read More:
- Vue error in render: “typeerror: cannot read property ‘length’ of undefined”
- [Solved] vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in render: “TypeError: Cannot read property ‘length‘
- [Solved] VUE Use Filters Error: [Vue warn]: Error in render: “TypeError: Cannot read property ‘toFixed’ of undefined”
- [Solved] Vue + uniapp Uncaught TypeError: Cannot read property ‘getters‘ of undefined
- [Solved] unhandled error during execution of watcher callback
- Vue ElementUI el-dropdown Error: Uncaught TypeError: Cannot read property ‘disabled‘ of null
- [Solved] Vue Error: Uncaught TypeError: Cannot read property ‘getters‘ of undefined
- VUE Echarts Loading Error TypeError: Cannot read property getAttribute of null?
- ElementUI Error in callback for watcher “data”: “Error: [ElTable] prop row-key is required”
- [Vue warn]: Error in render: TypeError: Cannot read property ‘xxxx’of undefined
- Uniapp: TypeError: Cannot read property ‘apply‘ of undefined (H5 does not report an error, but the real machine runs with an error)
- [Solved] TypeError: Cannot read property ‘indexOf‘ of undefined at VueComponent.resetFields
- Wechat program typeerror: a solution to cannot read property ‘SetData’ of undefined
- [Solved] Cannot read properties of undefined (reading ‘ajax‘); Cannot read property ‘ajax‘ of undefined
- Can’t read property ‘push’ of undefined [How to Solve]
- [Solved] uview u-sticky Error: Cannot read property ‘bottom‘ of null
- openlayers — Cannot read property ‘slice‘ of null—Map cannot be loaded
- VUE: Property or method “deleteFun“ is not defined on the instance but referenced during render. [How to Fix]
- El-cascader error: Cannot read property’level’ of null