Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.
The introduction
Whether it is a quick jump inside the small program, or from the outside into the small program are inseparable from the use of routing.
Today to talk about the small procedures of the route jump small knowledge
I. Small program route jump
<button bindtap='skipToTabPage'>The Tab page is displayed</button>
<button bindtap='skipToNotTabPage'>The non-tab page is displayed</button>
Copy the code
Switch to the Tab page and use switchTab
1.1 Usage of WX
Page({// Jump to TabPage, use switchTab, skipToTabPage() {wx.switchTab({
url: '/pages/listen/listen'})}, // Jump to a non-tab page, use navigateTo, can pass // in another page, use onLoad life cycle to receive parameter skipToNotTabPage() {wx.navigateTo({
url: '/pages/user/user? id=123&name=abc'})}})Copy the code
1.2 Usage of UNI
// Skip the interface uni.switchTab({
url: 'pages/search/search'}) // Jump to the secondary interface UNI.navigateTo({
url: 'pages/category/categ_lisst.html? catepos=23'
})
Copy the code
II Obtaining paths
2.1 Obtaining the path of small Programs
Default home page path:pages/index/index
Access: when editing the public article, you can specify a specific wechat for access
Pages /data/data.html? id=61
About the page: pages/about/about.html
“Pages /category/categ_lisst.html?” catepos=23
Pages /data/data.html? id=142
Search page: pages/search/search.html
Category module: Pages /category/ Category
Home page: pages/index/index
2.2 Obtaining the small program code
Using small program background generate small program code tool to obtain small program code, can specify the jump path, can be used for the public article, small program
see also
See the official documentation for more jumps to the tabBar page
Developers.weixin.qq.com/miniprogram…