vue3 debug

681 阅读1分钟

报错信息

runtime-core.esm-bundler.js:40         
[Vue warn]: Unhandled error during execution of component event handler 

组件事件处理程序执行期间未处理的错误

检查try..catch..finally异常处理是否缺乏,重点是否缺乏catch异常捕获处理流程。


报错信息

runtime-core.esm-bundler.js:40 
[Vue warn]: onMounted is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.

错误原因:使用了Vue3的写法但并非遵从Vue3的格式

错误解决

  • 查看script标签是否具有setup,没有则报错。