Regarding the data binding of el-table, an error occurred, and the main error message is as follows.
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”
Reason:
:data = param The result is that this param is an object. Example.
vue
<el-table :data="image.users" ref="usersRef" border>
</el-table>
js
image:{
users: {
cryptionType: 'sha256',
token: '',
userList: [
{
username: '',
password: '',
groups: '',
remark: ''
}
]
}
}
Users is an object, and: data is bound to an array.
My situation is that the interface here has been changed. Users used to be an array, but now it has become an object. The real user array has been changed to the userlist of the users object, but the front-end code has not been changed, resulting in such an error.
So the front-end code is changed to : data= image.users.userList
is normal.
Read More:
- Element Error when await is used in UI form submission [Solved]
- Element table Error: ‘tableId‘ of undefined“ [How to Solve]
- How to Solve Element Error: target is not existed: .page-component__scroll .el-scrollbar__wrap
- this.$el.querySelectorAll is not a function [How to Solve]
- [Solved] element-plus Error: Failed to resolve component
- Unknown custom element: [xxx] – did you register the component correctly…
- [How to Solve Vue warn]: Unknown custom element: did you register the component correctly?
- Error: array bound is not an integer constant before ‘]’ token
- Vue Error compiling template: Component template should contain exactly one root element. If you
- How to Solve Error: Element ‘dependency’ cannot have character [children], because the type’s content type is element-
- [Solved] Shell loop execute error: syntax error: bad for loop variable
- DataTables warning encountered using DataTables: table id = DataTables_Table_0 – Ajax error. For more information ab
- Using rpm to install WGet in CentOS 6.5 libc.so .6(GLIBC_ 2.14)(64bit) is needed by wget-1.14-18.el7_6.1.x86_sixty-four
- An error occurs when trying to pipe a python program to CD- sys.excepthook is missing lost sys.stderr
- [Solved] Upstream connect error or disconnect occurs after the k8s istio virtual machine is restarted
- How to Solve Error: “initializer element is not constant”
- [Solved] mybatis plus Error: Invalid bound statement (not found)
- React Hook “useState“ is called in function “xxx“ which is neither a React function component or
- Mybatis error under Springboot project: Invalid bound statement (not found)
- How to Fix “initializer element is not constant” error