Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vue] 说说你对vue的错误处理的了解? #472

Open
haizhilin2013 opened this issue Jun 22, 2019 · 2 comments
Open

[vue] 说说你对vue的错误处理的了解? #472

haizhilin2013 opened this issue Jun 22, 2019 · 2 comments
Labels
vue vue

Comments

@haizhilin2013
Copy link
Collaborator

[vue] 说说你对vue的错误处理的了解?

@haizhilin2013 haizhilin2013 added the vue vue label Jun 22, 2019
@xixileng
Copy link

xixileng commented Jul 1, 2019

分为errorCaptured与errorHandler。
errorCaptured是组件内部钩子,可捕捉本组件与子孙组件抛出的错误,接收error、vm、info三个参数,return false后可以阻止错误继续向上抛出。
errorHandler为全局钩子,使用Vue.config.errorHandler配置,接收参数与errorCaptured一致,2.6后可捕捉v-on与promise链的错误,可用于统一错误处理与错误兜底。

@censek
Copy link

censek commented Oct 16, 2019

http://www.imooc.com/article/288017?block_id=tuijian_wz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue vue
Projects
None yet
Development

No branches or pull requests

3 participants