关于el-table的数据绑定,发生了报错,主要的报错信息如下:
TypeError: Cannot read property ‘offsetHeight’ of null
Cannot read property ‘offsetHeight’ of null
this.$el.querySelectorAll is not a function
1 recursive calls
TypeError: data.reduce is not a function
Cannot read property ‘instance’ of undefined
Error in callback for immediate watcher “data”: “TypeError: data.indexOf is not a function”
- 原因:
:data = param 结果这个param是个对象。 - 示例:
vue
<el-table :data="image.users" ref="usersRef" border>
</el-table>
js
image:{
users: {
cryptionType: 'sha2