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 路由模式 #18

Open
RicoLiu opened this issue Jun 13, 2019 · 0 comments
Open

Vue 路由模式 #18

RicoLiu opened this issue Jun 13, 2019 · 0 comments

Comments

@RicoLiu
Copy link
Owner

RicoLiu commented Jun 13, 2019

Vue 项目打包静态资源后,嵌入混合开发的 app 中,路由切换时报错:静态资源找不到。

QQ20190613-0

webpack 打包已经改成相对路径,为什么还会报路径错误呢?

通过监控路由发现:在路由切换时,会导致上面的错误。

原来是因为项目中用 History 的路由模式引起的!如果使用 History 路由模式,需要服务端配置使用。

将路由模式改为 Hash 即可,不需服务端配合。

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

1 participant