当前位置:网站首页>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>
边栏推荐
- Chunfeng power and Huawei work together to build a smart Park benchmark, and the future factory innovation will reach a new level
- Try except add auxiliary new column
- List adding timer (positive and countdown)
- Brief introduction to mongodb working principle of mongodb series
- Upward and downward transformation
- Redis 如何实现库存扣减操作?如何防止商品被超卖?
- Grafana biaxial graph with your hands
- Bayesian Reference problem, mCMC and variational reference
- 如何通过W3school学习JS/如何使用W3school的JS参考手册
- Variational graph auto-encoders (VGAE)
猜你喜欢

易观分析《2022年中国银行业隐私计算平台供应商实力矩阵分析》研究活动 正式启动

H5 sunflower operation

Question brushing analysis tool

How many objects are created after new string ("hello")?

Markdown drawing Mermaid practical tutorial

math_ Proving common equivalent infinitesimal & Case & substitution

图神经网络入门 (GNN, GCN)

Jenkins Pipeline 对Job参数的处理

Installation and configuration of CGAL in PCL environment 5.4.1

Tencent tangdaosheng: facing the new world of digital and real integration, developers are the most important "architects"
随机推荐
Idea merge other branches into dev branch
请问下flinkcdc用flinksql提交的话只能一个表提交一个任务吗?那有几千张表的时候还能这么
Live app system source code, automatically playing when encountering video dynamically
H5 sunflower operation
C language file operation
PCL 环境下安装配置CGAL 5.4.1
Demo of integrated development of intelligent computing system 3 plugin
Figure introduction to neural networks (GNN, GCN)
智能计算系统1 环境搭建
echart:横向柱状图的类目文字位置调整
From design delivery to development, it is easy and efficient!
pd.cut 区间参数设定之前后区别
sql面试题:求连续最大登录天数
数据库学习笔记(SQL04)
微信小程序_8,视图与逻辑
C语言-函数知识点
How to learn JS through w3school / how to use the JS reference manual of w3school
Try except add auxiliary new column
Upward and downward transformation
I. The HR system is put on the enterprise wechat ISV to enhance the in-depth application of enterprise wechat in service chain retail and other industries