May 19, 2021 WeChat Mini Program Development Document
Jump to the tabBar page and close all other non-tabBar pages
Property | Type | The default | Required | Description |
---|---|---|---|---|
Url | string | Is | The path to the tabBar page that needs to be jumped (code pack path) (the page that needs to be defined in app.json's tabBar field) cannot be followed by parameters. | |
success | function | Whether | The interface calls a successful callback function | |
fail | function | Whether | The interface calls the failed callback function | |
complete | function | Whether | Callback function at end of interface call (call succeeds, fails are executed) |
{
"tabBar": {
"list": [{
"pagePath": "index",
"text": "首页"
},{
"pagePath": "other",
"text": "其他"
}]
}
}
wx.switchTab({
url: '/index'
})