vue.js:634 [Vue warn]: Error in created hook: "TypeError: this.list is not a function"
时间: 2023-08-26 07:08:51 浏览: 228
vue.js代码
引用\[1\]:根据提供的引用内容,报错信息是"TypeError: Object(…) is not a function",这是由于在created钩子函数中调用了一个不是函数的对象或变量导致的错误。引用\[2\]:另一个报错信息是"TypeError: this.list is not a function",这是因为在created钩子函数中调用了一个名为list的函数,但实际上它不是一个函数。解决这个问题的方法是将调用函数的代码从created钩子函数中移动到mounted钩子函数中。在mounted钩子函数中,组件已经被挂载到DOM上,可以安全地调用函数。所以,你可以将initCharts函数从created钩子函数中移动到mounted钩子函数中,这样就可以解决这个报错了。
#### 引用[.reference_title]
- *1* [2b0e:619 [Vue warn]: Error in created hook: “TypeError: Object(...) is not a func](https://blog.csdn.net/qq_30351747/article/details/116406071)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [2b0e:619 [Vue warn]: Error in created hook: “TypeError: Cannot read properties of](https://blog.csdn.net/z_langjitianya/article/details/127898258)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文