Index. WXML file
<! --index.wxml--> <view class="container"> <view> <! <button bindtap= <button bindtap= <button bindtap="golog" data-index="123"</button> <! -- Use the tag form to jump --> <! -- open-type Specifies the jump type --> <! NavigateTo navigateTo open only non-Tabbar pages without navigate == wx. Redirect == wx.redirectTo Redirect == wx.redirectTo Redirect == wx. NavigateBack == wx.navigateBack --> <! --> <navigator url="/pages/logs/logs" open-type="switchTab"> to jump tolog</navigator> </view> </view>Copy the code
Index. Js file
// Golog (e) {const {index} = e.currenttarget. Dataset // wx.navigateTo redirect to non-tabbar page /* wx.navigateTo({ url: `/pages/logs/logs? id=${index}}) */ //wx.switchTab ({url: '/pages/logs/logs? id=${index}`,
})
*/
console.log('Jump to log page',e)
},
Copy the code
Configuration in app.json file, tabbar configuration at the bottom
"tabBar": {
"custom": false."list": [{// Unselected icon graph"iconPath": "/images/home.png"// The currently selected icon icon"selectedIconPath": "/images/home_active.png"// Config page"pagePath": "pages/index/index"."text": "Home page"// Select the text color"selectedColor": "#00f"
},
{
"iconPath": "/images/logs.png"."pagePath": "pages/logs/logs"."text": "Details"."selectedColor": "#00f"."selectedIconPath": "/images/logs_active.png"}}]Copy the code