H5端路由接收参数
-
页面A跳转到页面B,并且携带参数:
toDetail(match_id) { console.log('详情', match_id) Taro.navigateTo({ url: '/pages/matches/detail?match_id=' + match_id }) }
页面B接收参数:
componentWillMount() { console.log('11', this) console.log('22', this.props) console.log('33', this.$router.params) }
然后控制台就疯狂报错:

网上很多帖子都说,直接在要接受的页面的生命周期中用this.$router.params
来接收,完全没毛用啊,而且打印 this 也没route相关的
我的是最新版本 3.0.8