当前位置:网站首页>Wechat applet_ 8. View and logic
Wechat applet_ 8. View and logic
2022-06-28 19:33:00 【icestone_ kai】
The goal is :
- Can know how to realize the navigation jump between pages
- Can know how to achieve the pull-down refresh effect
- You can know how to pull up and load more effects
- Be able to know the life cycle functions commonly used in small programs
Logic and view
What is page navigation :
Page navigation refers to the jump between pages , for example : There are two ways to realize page navigation in the browser
1. link
2.location.href
There are two ways to realize page navigation in applet :
1. Declarative navigation :
- Declare a... On the page
<navigatoe>Navigation components - By clicking on
<navigator>Component to realize page Jump
2. Programming navigation :
- Calling applet navigation API, Realize page Jump
Navigate to tabBar page :
tabBar A page refers to a page that is configured to tabBar The page of
In the use of <navigator> The component jumps 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 , Must be switchTab
The example code is as follows :
<navigator url="/pages/message/message" open-type="switchTab"> Navigate to message Loop page </navigator>
- Be careful , here tabBar The configured page needs to be displayed in
app.jsonMediumtabBarThe page configured under the node will jump !
Navigate to non tabBar page :
Through non declarative navigation
Not tabBar A page is one that is not configured to tabBar The page of
In the use of <navigator> Component jump to non tabBar When the page is , You need to specify 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
navigator
The example code is as follows :
<navigator url="/pages/for/for" open-type="navigate"> Navigate to for Loop page </navigator>
there url Attributes only need to be in app.json Of pages The node can be configured
Be careful : For simplicity , Navigate to non tabBar When the page is ,open-type="navigate" Properties can be omitted
Back navigation :
If you want to go back to the previous page or multi-level page , You need to specify open-type and delta attribute , among :
- 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 that you want to navigate backwards
The sample code is as follows :
<navigator open-type="navigateBack" delta="-1">
Return to upper level
</navigator>
边栏推荐
- Bayesian inference problem, MCMC and variational inference
- kettle(六):基于Kettle的数据库全量备份
- Leetcode 周赛299
- How many objects are created after new string ("hello")?
- 判断字符串是否为空
- Analysys analytics' 2022 China Banking privacy computing platform supplier strength matrix analysis' research activity was officially launched
- 视差js特效js轮播图插件
- 大火的虚拟人在哪些产业开始发力?
- Friends from Fujian, your old-age insurance is on the cloud!
- 找出连续7天登陆,连续30天登陆的用户
猜你喜欢

Nanopc-t4 (rk3399) Game1 OLED (I2C) display time weather temperature

Upward and downward transformation

月环比sql实现

i人事HR系统上架企业微信ISV,增强企微在服务连锁零售等行业深度应用

Analysys analytics' 2022 China Banking privacy computing platform supplier strength matrix analysis' research activity was officially launched

论文3 VScode&texlive&SumatraPDF打造完美书写论文工具

机器学习笔记 temperature+Softmax

Group programming TIANTI competition exercise - continuously updating

How to change the status bar at the bottom of win11 to black? How to change the status bar at the bottom of win11 to black

内核错误怎么解决?Win11系统内核错误解决方法
随机推荐
Building tin with point cloud
Intelligent computing system 1 environment construction
微信小程序_8,视图与逻辑
Brief introduction to mongodb working principle of mongodb series
The amazing nanopc-t4 (rk3399) is used as the initial configuration and related applications of the workstation
Variational graph auto-encoders (VGAE)
C language file operation
shell读取Json文件的值
怎样去除DataFrame字段列名
F(x)构建方程 ,梯度下降求偏导,损失函数确定偏导调整,激活函数处理非线性问题
Hands on Teaching of servlet use (1)
Live app system source code, automatically playing when encountering video dynamically
G biaxial graph SQL script
易观分析《2022年中国银行业隐私计算平台供应商实力矩阵分析》研究活动 正式启动
math_证明常用等价无穷小&案例&代换
Kaggle肠胃道图像分割比赛baseline
论文阅读:Duplex Contextual Relation Network for Polyp Segmentation
F (x) construct the equation, calculate the partial derivative by gradient descent, determine the partial derivative adjustment by loss function, and deal with nonlinear problems by activation functio
h5向日葵作业
Web3 that unleashes the value of the Internet