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
rq(opt).then( res => { wx.hideToast(); const data = res.data; if (data.code === 200 ) { }else { this.$route('../add/add'); /wx.navigateTo({ url: '../add/add' })/ } }).catch(()=>{ wx.hideToast(); })
The text was updated successfully, but these errors were encountered:
如果把this.$route换成wx.navigateTo那就正常跳转
Sorry, something went wrong.
$route是框架封装的跳转接口,路径是有限制的。
用法:$route(pagename[, config])
this.$route('play?vid=xxx&cid=xxx');
我配置的是 wxpage.A({ config:{ route: '/pages/$page/$page' } }) 如果我按 this.$route('add'); 这样来跳转,会直接报找不到文件 只能按下面这个方式来 this.$route('../add/add'); 才可以,而且必须是放在 onReady才正常, 如果放在 onLoad 的话,会时好时坏
wxpage.A({ config:{ route: '/pages/$page/$page' } })
this.$route('add');
this.$route('../add/add');
onReady
onLoad
route: '/pages/$page/$page' 实际上是告诉框架,怎样取到正确的页面路径,
route: '/pages/$page/$page'
在上述配置中,this.$route('add');实际上会被转换为
wx.navigateTo({url: '/pages/add/add'})
No branches or pull requests
rq(opt).then( res => {
wx.hideToast();
const data = res.data;
if (data.code === 200 ) {
}else {
this.$route('../add/add');
/wx.navigateTo({
url: '../add/add'
})/
}
}).catch(()=>{
wx.hideToast();
})
The text was updated successfully, but these errors were encountered: