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

2.2.1 触发代理那一段,hasHandler和getHandler写反了吧? #3

Open
duanruimin26 opened this issue Jan 9, 2021 · 1 comment

Comments

@duanruimin26
Copy link

那么代理的处理函数又是什么?我们回过头看看代理选项handlers的实现。 handers函数会根据 options.render._withStripped的不同执行不同的代理函数,当使用类似webpack这样的打包工具时,通常会使用vue-loader插件进行模板的编译,这个时候options.render是存在的,并且_withStripped的属性也会设置为true(关于编译版本和运行时版本的区别可以参考后面章节),所以此时代理的选项是hasHandler,在其他场景下,代理的选项是getHandler。getHandler,hasHandler的逻辑相似,我们只分析使用vue-loader场景下hasHandler的逻辑。另外的逻辑,读者可以自行分析。


应该是:所以此时代理的选项是getHandler,在其他场景下,代理的选项是hasHandler。

@MarvinXu
Copy link

MarvinXu commented Nov 4, 2021

作者貌似好久不上github了

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

No branches or pull requests

2 participants