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

3.3.18 taro路由问题 #11004

Closed
sanmmm opened this issue Dec 29, 2021 · 2 comments · Fixed by #11026
Closed

3.3.18 taro路由问题 #11004

sanmmm opened this issue Dec 29, 2021 · 2 comments · Fixed by #11026
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects

Comments

@sanmmm
Copy link

sanmmm commented Dec 29, 2021

相关平台

H5

复现仓库

https://github.com/sanmmm/taro_report
浏览器版本: chrome 96.0.4664.110
使用框架: React

复现步骤

测试版本为: 3.3.18

  1. 设置basename, 访问 /basename 没有重定向到默认的 /basename/pages/index/index 页
  2. 访问 /basename/pages/index/index?a=1,通过useRouter 获取不到params

期望结果

如上

实际结果

如上

环境信息


  Taro CLI 3.3.18 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.17.5 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.17 - C:\Program Files\nodejs\yarn.CMD
      npm: 6.14.14 - C:\Program Files\nodejs\npm.CMD
@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Dec 29, 2021
@ZakaryCode ZakaryCode added this to Padding in H5 Dec 31, 2021
@ZakaryCode
Copy link
Contributor

  1. 设置basename, 访问 /basename 没有重定向到默认的 /basename/pages/index/index 页
  • 该问题未能复现到,可以升级解决
  1. 访问 /basename/pages/index/index?a=1,通过useRouter 获取不到params
  • browser 模式确实有这个问题,下一个版本修复

@molunhui
Copy link

hash模式下,首页的自定义路由也没有生效;比如 设置: '/pages/index/index': '/'; 浏览器打开 xxx/#/; 默认跳转到 xxx/#/pages/index/index了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
H5
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants