We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
H5
浏览器版本: 版本 85.0.4183.121(正式版本) (64 位) 使用框架: React
首页
我的
import React from "react"; import { View } from "@tarojs/components"; import Taro from "@tarojs/taro"; export default function Index() { const goMine = () => { Taro.navigateTo({ url: "/pages/mine/index?id=1" }); }; return <View onClick={goMine}>跳转至我的页面</View>; }
import React from "react"; import { View } from "@tarojs/components"; import Taro, { useRouter } from "@tarojs/taro"; export default function Index() { const router = useRouter(); console.log("router--------->>", router.params); return <View>我是MINE</View>; }
console.log("router--------->>", router.params);输出结果应为{id:1}
console.log("router--------->>", router.params);输出结果为 {}
Taro v3.0.14 Taro CLI 3.0.14 environment info: System: OS: macOS 10.15.6 Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.16.3 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.7 - /usr/local/bin/npm npmPackages: @tarojs/cli: 3.0.14 => 3.0.14 @tarojs/components: 3.0.14 => 3.0.14 @tarojs/mini-runner: 3.0.14 => 3.0.14 @tarojs/react: 3.0.14 => 3.0.14 @tarojs/runtime: 3.0.14 => 3.0.14 @tarojs/taro: 3.0.14 => 3.0.14 @tarojs/webpack-runner: 3.0.14 => 3.0.14 babel-preset-taro: 3.0.14 => 3.0.14 eslint-config-taro: 3.0.14 => 3.0.14 react: ^16.10.0 => 16.14.0 taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.3 npmGlobalPackages: typescript: 3.9.7
The text was updated successfully, but these errors were encountered:
fix(router): 默认指定 h5 router mode 为 hash,close #7871
2ee2d40
我是直接使用H5的获取url,然后自己截取处理
Sorry, something went wrong.
64361e4
Successfully merging a pull request may close this issue.
相关平台
H5
浏览器版本: 版本 85.0.4183.121(正式版本) (64 位)
使用框架: React
复现步骤
首页
跳转到我的
页面首页代码
我的页面 代码
期望结果
console.log("router--------->>", router.params);输出结果应为{id:1}
实际结果
console.log("router--------->>", router.params);输出结果为 {}
环境信息
The text was updated successfully, but these errors were encountered: