-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
getCurrentInstance().router.params取不到值 #7853
Comments
router.mode="hash"是取不值的, |
哪里可以设置? |
config -> index |
看看传递的参数中有没有包括'?'这个字符 |
有的,就是hash模式就跟不到值 |
反正我之前测的是如果参数带有'?'这个字符,那么后面的参数就传不出去 |
vue 也用不了getCurrentInstance |
config-> index->h5 添加代码 |
3.0.14版本也有问题 ,将getCurrentInstance().router.params替换Current.router.params 还是获取不到参数啊。 @Chen-jj @tangzhangzheng . 修改 router: { mode: 'browser' } 是可以正常工作的,还有不加这个配置,路由调整和之前(3.0.5)也不一样了, 1,3.0.5 时H5打开路由是 http://192.168.31.34:10086/subpackages/doctor/pages/DoctorDetail?pId=8 问一下,为什么会有上面的表现 |
@xiehui999 hash路由和browser路由模式可以简单看下, |
这个问题在3.0.15依然存在 |
不会用不了吧,可以另外提个 issue |
可以了,文档不够详细,没说要引入 |
感谢 可以了,文档不够详细,没说要引入import {getCurrentInstance} from "@tarojs/taro"才能用 |
相关平台
H5
浏览器版本: Chrome next
使用框架: React
复现步骤
getCurrentInstance().router.params取不到值
期望结果
getCurrentInstance().router.params取到上一个页面跳转到本页面带的参数
实际结果
拿到参数
环境信息
The text was updated successfully, but these errors were encountered: