Closed zhuddan closed 1 month ago
[!CAUTION]
Review failed
The head commit changed during the review from 981fcc96f05061096b13d4d6cdc4435f910a9e02 to 28e7d2a53a453814f7f2ba4bbd694e7d051841b1.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
感觉应该是 query
参数吧, params
参数 uniapp
不支持。
你这里用 params
表示了 vue router
的 query
的概念。
建议这里不要修改原对象options,重新赋值给一个新的对象,传给uni的api。以防止用户执行完语句后,再次使用参数对象,会出现意想不到的修改 https://github.com/zhuddan/uni-use/blob/28e7d2a53a453814f7f2ba4bbd694e7d051841b1/src/useRouter/index.ts#L102-L108
描述
这个 PR 新增了类似 vue router 的 query 参数模式。
额外上下文
我明白这个模式不符合
uni-app
的默认跳转方式,但我习惯了 Vue 原生路由的参数传递方式,因此非常需要这个功能。它支持在路由跳转时携带参数,并在页面中获取这些参数。以下是一个使用示例:尽管这个模式与
uni-app
的跳转机制有所冲突,但它极大地提高了我的开发效率。关于测试,由于单元测试不支持getCurrentPages
,目前尚未找到合适的解决方案,因此我只测试了utils
中新增的函数。文档部分已根据新功能进行了相应修改。请仔细审查这个 PR 的变更内容,如果可以,希望能够合并,因为这个功能对我的项目非常重要。