lblblong / tarojs-router-next

Taro 小程序路由库/自动生成带参数类型提示的路由方法/允许传递任意类型、任意大小的参数数据/同步的路由方法调用/koa体验一致的路由中间件
https://lblblong.github.io/tarojs-router-next/
MIT License
248 stars 23 forks source link

Router.to*方法问题 #58

Open LrainchenL opened 1 year ago

LrainchenL commented 1 year ago

app.config.js 'pages/track-declaration/index', pages/index/index.vue const onTrackDeclaration = () => { Router.toTrackDeclaration() } image image image

不知道是哪里出现了问题,找不到方法解决,只好来这边请教一下

lblblong commented 1 year ago

其他页面可以跳转吗

LrainchenL commented 1 year ago

其他页面可以跳转吗

组合命名的貌似都不行 例如: news-detail(toNewsDetail),signing-service(toSigningService),healthy-line(toHealthyLine) 一个单词的就可以: 例如: archives(toArchives),login(toLogin)

LrainchenL commented 1 year ago

healthy-line需要将文件夹命名成healthyLine,然后再Router.tohealthyLine()这样就可以行,如果命名成healthyline,再使用Router.tohealthyline()跟上图报错一样

lblblong commented 1 year ago

用的是哪个版本的 tarojs-router-next

LrainchenL commented 1 year ago

用的是哪个版本的 tarojs-router-next

"tarojs-router-next": "^3.1.1", "tarojs-router-next-plugin": "^3.1.1", 应该是最新的吧

lblblong commented 1 year ago

能提供一个可以复现的项目吗

LrainchenL commented 1 year ago

能提供一个可以复现的项目吗

刚刚在弄复现demo的时候发现把依赖删了重装就可以了,但是不能改文件夹名字,一改就坏

lblblong commented 1 year ago

一改就坏是说又变回之前的样子吗

LrainchenL commented 1 year ago

嗯,是的,就是上图发的报错一样,如果需要改文件夹名称的话,就必须要删除依赖后重装就可以了

lblblong commented 1 year ago

你用的什么包管理工具

LrainchenL commented 1 year ago

npm

lblblong commented 1 year ago

emm,我这边没什么问题,如果方便的话还是提供一个复现的demo比较好定位问题

LrainchenL commented 1 year ago

https://github.com/LrainchenL/taro-demo.git image 可以将healthyline改成healthy-line试试 然后相应的地方再改动一下 image image

lblblong commented 1 year ago

1666861842397 image

我这边测试好像是没有问题的,每次修改之后对应的路由方法都会变化,你可以点这个链接看看: https://lrainchenl-tarodemo-f4gjv5wgdc5.ws-us73.gitpod.io

liqiuqiui commented 1 year ago

我今天也遇到这个问题了,安装taro-router-next之前创建的页面生成的方法能正常使用,使用了这个路由库之后新创建的页面生成的方法就报这个错误了,只删除taro-router-next和taro-router-next-plugin重新安装,重新生成dist还是不行,把node_modules删除,重新安装、生成dist就都能用了。