当前位置:网站首页>Applet page navigation
Applet page navigation
2022-07-18 20:40:00 【new Promise】
There are two ways to realize page navigation in applet
- Declarative navigation
- Declare a navigation component on the page
- Click the component to realize page Jump
- Programming navigation
- Calling applet navigation API, Realize page Jump
One 、 Declarative navigation
1. Navigate to tabBar page
tabBar A page refers to a page that is configured to tabBar The page of
When using the component, jump to the specified tabBar When the page is , You need to specify the url Properties and open-type attribute , among :
- url Indicates the page address to jump to , Must be / start
- open-type Indicates how to jump , It has to be for switchTab
<navigator url="/pages/message/message" open-type="switchTap"> Navigate to the message page </navigator>
2. Navigate to non tabBar page
Not tabBar page : Not in the tabBar Configured page
Jump to normal non tabBar When the page is , You need to specify url Properties and open-type attribute :
- url Indicates the page address to jump to , Must be / start
- open-type Indicates how to jump , It has to be for navigate
<navigator url="/pages/info/info" open-type="navigate"> Navigate to non tabBar page </navigator>Navigate to non tabBar When the page is ,open-type=“navigate” You can omit it , You can also navigate to the specified page
3. Back navigation
If you want to go back to the previous page or multi-level page , You need to specify open-type Properties and delta attribute ,:
- open-type The value of must be navigateBack, Indicates that you want to perform back navigation
- delta The value of must be a number , Indicates the level to go back
<navigator open-type="navigateBack" delta="1"> Go back to the previous page </navigator>notes : If you just go back to the previous page , be delta You can omit it , Because the default value is 1
Two 、 Programming navigation
1. Navigate to tabBar page
call wx.switchTab(object,object) Method , You can jump to tabBar page , among object The properties of the parameter object are as follows :
Sample code :
<button bindTab="goMessage"> Jump to message</button> goMessage(){ wx.switchTab({ url:"/pages/message/message" }) }
2. Jump to non tabBar page
call wx.switchTo(object,object) Method , You can jump to non tabBar page . among object Attribute list of parameter object :
Sample code :
<button bindtap="goInfo"> Jump to non tabBar page </button> goInfo(){ wx.navigateTo({ url:'/pages/info/info' }) },
3. Back navigation
call wx.navigateback(object,object) Method , You can return to the previous page or multiple pages ; among object The attribute list of parameter formation is as follows :
Sample code :
<button bindtab="goBack"> Back to previous page </button> goBack(){ wx.navigateBack({ delta:1 // The default is 1, You can omit it }); },
边栏推荐
- go ———数组与切片的区别
- Go -- the difference between array and slice
- 程序员都不懂的代码
- 21、当在浏览器中输入了URL之后,程序是怎样执行的?
- 从 0 到 1 搭建企业级数据治理体系!
- 有点东西,竟然把VSCode玩成了IDEA的效果
- Interface test - verify parameter validity / fault tolerance test
- Payment process interview ideas
- OpenGL es learning (2) -- vertex shaders and slice shaders
- Code that programmers can't understand gradually fade out 1920-500 (1)
猜你喜欢

Why should V-for add key

How to use modify run configuration on pychart with parameter configuration

长安链tls基础研究

Codeforces Round #806 (Div. 4)(A.B.C.D.E.F)
![[Xuelang download tutorial] 05 Xuelang download's official packet capture Download](/img/76/a8549c50918c355154ed33bc8b50f2.png)
[Xuelang download tutorial] 05 Xuelang download's official packet capture Download

【企业微信自建应用开发】

OSPF theory

Research on driverless dynamic obstacle avoidance strategy | robot dynamic obstacle avoidance strategy

1.爬虫概述

Taote keyword search commodity API interface (commodity list interface, sales volume sorting interface, commodity sales volume interface)
随机推荐
Fade in and fade out 1920-500 (8)
【学浪下载教程】03学浪下载之Proxifier设置
Basic research on Chang'an chain TLS
[word] the inserted formula is grayed out, and the failure is solved
阿里云视频点播
1.2.2-sql injection - SQL injection syntax type - error injection
feign调用传递请求头
2022.7.4-7.10 AI industry weekly (issue 105): snails
Error: cannot read properties of undefined (reading 'foreach')
MySQL 66 questions, 20000 words + 50 pictures in detail! A little six!
go的命令行库--cobra使用
面试问题五
Parallel and distributed framework
ccf真题(怒拿100昏)
netstat常用场景记录
World Tour Finals 2019 D - Distinct Boxes 题解
机器学习|BP(Back Propagation)神经网络
[sword finger offer II 041. Average value of sliding window]
你猜不到的代码
【uniapp调用微信支付】uniapp开发小程序-调用微信支付


