当前位置:网站首页>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
边栏推荐
- 【数字IC验证快速入门】2、通过一个SoC项目实例,了解SoC的架构,初探数字系统设计流程
- 走入并行的世界
- 资源道具化
- Introduction to dead letter queue (two consumers, one producer)
- CCPC 2021 Weihai - G. shinyruo and KFC (combination number, tips)
- A solution to PHP's inability to convert strings into JSON
- 【数字IC验证快速入门】7、验证岗位中必备的数字电路基础知识(含常见面试题)
- 1. Strengthen learning basic knowledge points
- How to select the Block Editor? Impression notes verse, notation, flowus
- [quick start of Digital IC Verification] 1. Talk about Digital IC Verification, understand the contents of the column, and clarify the learning objectives
猜你喜欢
全国爱眼教育大会,2022第四届北京国际青少年眼健康产业展会
Rainbond 5.7.1 支持对接多家公有云和集群异常报警
Leetcode: binary tree 15 (find the value in the lower left corner of the tree)
【数字IC验证快速入门】8、数字IC中的典型电路及其对应的Verilog描述方法
[Yugong series] go teaching course in July 2022 004 go code Notes
关于BRAM IP复位的优先级
CVPR 2022 | 常见3D损坏和数据增强
信息学奥赛一本通 1339:【例3-4】求后序遍历 | 洛谷 P1827 [USACO3.4] 美国血统 American Heritage
小程序全局配置
Fundamentals - configuration file analysis
随机推荐
19 Mongoose模块化
Is it safe for Galaxy Securities to open an account online?
插值查找的简单理解
Oracle tablespace management
Ffplay document [easy to understand]
基础篇——配置文件解析
Usaco3.4 "broken Gong rock" band raucous rockers - DP
- Oui. Net Distributed Transaction and Landing Solution
Leetcode (695) - the largest area of an island
Document method
Informatics Orsay all in one 1339: [example 3-4] find the post order traversal | Valley p1827 [usaco3.4] American Heritage
Ros2 topic [01]: installing ros2 on win10
Fundamentals - configuration file analysis
c語言oj得pe,ACM入門之OJ~
.Net分布式事務及落地解决方案
Hong Kong stocks will welcome the "best ten yuan store". Can famous creative products break through through the IPO?
3.3、项目评估
Leetcode brush question: binary tree 13 (the same tree)
Leetcode skimming: binary tree 12 (all paths of binary tree)
[record of question brushing] 1 Sum of two numbers