当前位置:网站首页>Applet page navigation
Applet page navigation
2022-07-05 20:26:00 【'wx】
1. What is page navigation
Page navigation refers to the mutual jump between pages
2. There are two ways to realize page navigation in applet
(1). Declarative navigation
Create a... On the page <navigator> Navigation components
By clicking on <navigator> Component to realize page Jump
(2) Programming navigation
Calling applet navigation API, Realize page Jump
3. Declarative navigation
Navigate to tabBar page
Navigate to non tabBar page
<navigator url="/pages/info/info?name=xiaoming&age=20">
<button> Pass parameters </button>
</navigator>
Be careful : For convenience , Navigate to non tabBar When the page is ,open-type Properties can be omitted
4. Back navigation
Be careful , If you only go back to the top page , It can be omitted delta attribute , The default value is 1
5. Programming navigation
call wx.switchTab(Object object) Method , You can jump to tabBar page , among Object The attribute list of the parameter object is as follows :
attribute | type | Whether the choice | explain |
url | string | yes | Need to jump tabBar The path of the page , The path cannot be followed by parameters |
success | function | no | Interface calls the successful callback function |
fail | function | no | Interface call failed callback function |
complete | function | no | The callback function at the end of the interface call ( Successful call 、 Failure will be carried out ) |
// Page structure
<view> Programming navigation parameters </view>
<button bindtap="goToInfo2"> Click to jump to info</button>
// Logical processing
goToInfo2(){
wx.navigateTo({
url: '/pages/info/info?name=lisi&age=20',
})
},
6. Back navigation
call wx.navigateBack(Object obkect) Method , You can return to the previous page or multiple pages .
attribute | type | The default value is | Whether the choice | explain |
delta | number | 1 | no | Number of pages returned , If delta Larger than the existing Number of pages , Then go back to the home page |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface call failed callback function | |
complete | function | no | The callback function at the end of the interface call ( Successful call 、 Failure will be carried out ) |
7. Navigation parameters
navigator Component's url Property is used to specify the page path to jump to , Parameters can be carried behind the path
Between parameter and path ? Division
Parameter key value pair adoption = The way
Use... For different parameters & Division
You can jump the route onLoad Get the routing parameters directly from the event
边栏推荐
- Document method
- 【数字IC验证快速入门】2、通过一个SoC项目实例,了解SoC的架构,初探数字系统设计流程
- [quick start to digital IC Verification] 8. Typical circuits in digital ICs and their corresponding Verilog description methods
- C langue OJ obtenir PE, ACM démarrer OJ
- 信息学奥赛一本通 1339:【例3-4】求后序遍历 | 洛谷 P1827 [USACO3.4] 美国血统 American Heritage
- Pytorch 1.12 was released, officially supporting Apple M1 chip GPU acceleration and repairing many bugs
- . Net distributed transaction and landing solution
- Some problems encountered in cocos2d-x project summary
- 1:引文;
- sort和投影
猜你喜欢
1、强化学习基础知识点
[quick start of Digital IC Verification] 6. Quick start of questasim (taking the design and verification of full adder as an example)
2022北京眼睛健康用品展,护眼产品展,中国眼博会11月举办
CVPR 2022 | common 3D damage and data enhancement
About the priority of Bram IP reset
走入并行的世界
IC科普文:ECO的那些事儿
1. Strengthen learning basic knowledge points
JS implementation prohibits web page zooming (ctrl+ mouse, +, - zooming effective pro test)
实操演示:产研团队如何高效构建需求工作流?
随机推荐
Leetcode(347)——前 K 个高频元素
ICTCLAS word Lucene 4.9 binding
Leetcode skimming: binary tree 16 (path sum)
Leetcode brush question: binary tree 13 (the same tree)
mongodb/文档操作
鸿蒙系统控制LED的实现方法之经典
Rainbond 5.7.1 支持对接多家公有云和集群异常报警
Enter the parallel world
Mongodb basic exercises
- Oui. Net Distributed Transaction and Landing Solution
IC科普文:ECO的那些事儿
Rainbow 5.7.1 supports docking with multiple public clouds and clusters for abnormal alarms
信息学奥赛一本通 1337:【例3-2】单词查找树 | 洛谷 P5755 [NOI2000] 单词查找树
Is it safe for Galaxy Securities to open an account online?
本季度干货导航 | 2022年Q2
mongodb文档间关系
3.3、项目评估
信息学奥赛一本通 1339:【例3-4】求后序遍历 | 洛谷 P1827 [USACO3.4] 美国血统 American Heritage
[quick start of Digital IC Verification] 9. Finite state machine (FSM) necessary for Verilog RTL design
常用的视图容器类组件