为什么推荐在路由中使用异步组件 #2135
Unanswered
yingside
asked this question in
Help and Questions
为什么推荐在路由中使用异步组件
#2135
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
当使用路由懒加载的时候,点击对应的路由,在index.html的head中,才会加载对应的路由。
那如果出现了切换过去的路由页面较大,代码较多,点击之后才加载,这样并不能起到link标签的modulepreload的效果啊
我试着使用了异步组件,发现可以在一开始就将link标签插入到index.html的head中,这样不是对于modulepreload的功能更好的利用吗?
为什么在router网站上,还专门提示注意:不要在路由中使用异步组件?
Beta Was this translation helpful? Give feedback.
All reactions