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
dynamic-load 时,路由有多级路径时找不到拆分的.js文件 #102
Comments
webpack 的 publicPath 配成 |
@yinlsea 请问你的vsc,对react的项目支持如何? 我用默认的,也尝试安装了几个扩展, 但是当遇到 |
@xjdata 解析构符号也识别不了,你有什么插件嘛 |
用 idea 或 webstorm 啊,官方更新很快,支持也很全。 |
@ohmyauthentic 木有~ 没办法换了webstorm~ |
解决了,用browserHistory,按需加载的时候需要这样写: dva({ |
解决了,用browserHistory,按需加载的时候需要这样写: dva({ |
1 similar comment
解决了,用browserHistory,按需加载的时候需要这样写: dva({ |
你好,我按你的方式解决了子目录的问题,但是现在多级路径,在一级路径入http://localhost:8989/indexpage按f5刷新可以,但是http://localhost:8989/indexpage/test1按f5就不行,报找不到.js文件 |
@yinlsea 请问下 ROOTPATH是指什么 ,我用Link to='/xx/xx' 可以 顺利进去多级路径,F5刷新进不了i |
ROOTPATH就是你的根路径,例如:"/XXX/“,访问就是http://IP:PORT/XXX/ |
把user-dashboard示例按照dynamic-load示例只改造router.js,如下:
history使用browserHistory时,如果路由到/demo/users路径,则会请求127.0.0.1:8989/demo/0.js,出现404报错
history如果使用hashHistory则没有问题,请求的是127.0.0.1:8989/0.js
如果直接路由到/users,则不管是hashHistory还是browserHistory都没有问题。
The text was updated successfully, but these errors were encountered: