qq_柒年_2
2018-07-30 11:32
视频中,点了每一条都是跳转到同一个界面了,有什么方法可以跳转到其他页面吗?
switch(index){
case 0: wx.navigateTo({url: '/pages/detail/detail?title=' + title})
break;
case 1: wx.navigateTo({ url: '/pages/detailA/detailA?title=' + title })
break;
default: wx.navigateTo({ url: '/pages/detailB/detailB?title=' + title })
}
if (index == 0) {
wx.navigateTo({
url: '/pages/detail/detail?title=' + title,
})
}else if(index==1){
wx.navigateTo({
url: '/pages/detailA/detailA?title=' + title,
})
} else{
wx.navigateTo({
url: '/pages/detailB/detailB?title=' + title,
})
}
然后在app.json中
"pages":[
"pages/index/index",
"pages/jion/jion",
"pages/detail/detail",
"pages/detailA/detailA",
"pages/detailB/detailB",
"pages/logs/logs"
],
就可以了,我已经试过了!其实用if 太麻烦,可以使用switch case的语句来
可以做if语句判断
入门微信小程序开发
172015 学习 · 323 问题
相似问题