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

配置hash history后,路径不正确 #2597

Closed
jing-wu opened this issue Jun 13, 2019 · 10 comments
Closed

配置hash history后,路径不正确 #2597

jing-wu opened this issue Jun 13, 2019 · 10 comments

Comments

@jing-wu
Copy link

jing-wu commented Jun 13, 2019

config.ts中配置:
history: 'hash',
base: '/learn',

期望:http://localhost:8000/learn/#/index
实际:http://localhost:8000/#/learn/index

并且后续的路由跳转(例如回到首页),浏览器中的#没了,又变成了browserHistory的形式:
http://localhost:8000/learn/index

@JustForLucky
Copy link

遇到同样的问题,umi version是2.7.5

@JustForLucky
Copy link

可以换到2.6.16版本,是正常的

@Monsterbx
Copy link

也遇到同样的问题,history:'hash' 设置不成功。切换2.6的umi版本可以。
image

@mizi-lin
Copy link
Contributor

the some

而且 NavLink 中 会把 base 带到路径中去

@mizi-lin
Copy link
Contributor

如果 umi 版本回退到 v2.6.16
出现如下问题
image

还需将 umi-plugin-dva 版本回退

"umi-plugin-dva": "1.5.3"

@mizi-lin
Copy link
Contributor

mizi-lin commented Jun 13, 2019

@sorrycc

可复现地址

git@github.com:mizi-lin/umi-issues.git

望急修

@xf564246963
Copy link

ant-design-pro2.3.1的umi2.4.4也有这个问题

@sorrycc
Copy link
Member

sorrycc commented Jun 17, 2019

@amily4555 不能复现?

@sorrycc
Copy link
Member

sorrycc commented Jun 17, 2019

有问题再 reopen。

@sorrycc sorrycc closed this as completed Jun 17, 2019
@DiamondYuan DiamondYuan reopened this Jun 18, 2019
@DiamondYuan
Copy link
Member

DiamondYuan commented Jun 18, 2019

同样遇到问题。复线方法如下。

https://github.com/DiamondYuan/vanaheim

修改 packages/vanaheim-website/.umirc.ts 的 history 为 'hash'

yarn && yarn bootstrap && yarn dev-website

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

7 participants