点击跳转没反应,为什么呢?
新建一个小程序把代码和相关文件复制进去却可以跳转。
app.json:
{
“pages”: [
“pages/welcome/welcome”,
“pages/post/post”,
“pages/movie/movie”,
“pages/post/post-comment/post-comment”,
“pages/post/post-detail/post-detail”
],
“window”: {
“navigationBarBackgroundColor”: “#4A6141”
},
“tarBar”:{
“borderStyle”:“white”,
“selectedColor”:"#4A6141",
“color”:"#333",
“backgroundColor”:"#fff",
“position”:“bottom”,
“list”:[
{
“pagePath”:“pages/post/post”,
“text”:“文字”,
“iconPath”:“images/icon/wx_app_news.png”,
“selectedIconPath”:“images/icon/[email protected]”
},
{
“pagePath”:“pages/movie/movie”,
“text”:“光影”,
“iconPath”:“images/icon/wx_app_movie.png”,
“selectedIconPath”:“images/icon/[email protected]”
}
]
}
}
pages/welcome/welcome.js:
onTapJump: function (event) {
wx.switchTab({
url: ‘…/post/post’
})
},
<!–pages/welcome/welcome.wxml–>
<view class=“container”>
<image class=“avatar” src="…/…/images/avatar/avatar1.jpg"> </image>
<text class=“motto”>Hello</text>
<view catchtap=‘onTapJump’ class=“journey-container”>
<text class=“journey”>开启小程序之旅</text>
</view>
</view>