当前位置:网站首页>HarmonyOS笔记-----------(三)
HarmonyOS笔记-----------(三)
2022-07-30 19:46:00 【头秃小程】
1.生命周期
页面A的生命周期接口的调用顺序
- 打开页面A:onInit() -> onReady() -> onShow()
- 在页面A打开页面B:onHide()
- 从页面B返回页面A:onShow()
- 退出页面A:onBackPress() -> onHide() -> onDestroy()
- 页面隐藏到后台运行:onInactive() -> onHide()
- 页面从后台运行恢复到前台:onShow() -> onActive()
2.案例
cookbook相关代码
<element name= "cb-swiper" src="./swiper/swiper"></element>
<element name= "cb-hotcate" src="./hotcate/hotcate"></element>
<div class= "cb-container">
<div class="cb-title">
<text>美食大全</text>
</div>
<div class="cb-body">
<list>
<list-item class="cb-body-item">
<cb-swiper list="{
{list}}"></cb-swiper>
</list-item>
<list-item class="cb-body-item">
<cb-hotcate></cb-hotcate>
</list-item>
</list>
</div>
</div>.cb-container {
flex-direction: column ;
}
.cb-body {
flex: 1;
}
.cb-body-item{
flex-direction: column;
}
.cb-title {
width: 100%;
height: 44px;
justify-content: center;
align-items: center;
background-color: #ee742f;
}
text{
font-size: 16px;
font-weight: normal;
color:#fff;
}// @ts-nocheck
import list from '../../../common/data/cook-list.json';
export default {
data: {
list: []
} ,
onInit() {
this.list=list.data
}
}边栏推荐
猜你喜欢

MySQL six-pulse sword, SQL customs clearance summary

ERROR 1045 (28000) Access denied for user 'root'@'localhost'Solution

The advanced version of the cattle brushing series (search for rotating sorted arrays, inversion of the specified range in the linked list)

Linux下最新版MySQL 8.0的下载与安装(详细步骤)
![[Node implements data encryption]](/img/8b/f9ff44c39fc9e80b2f2d2626a74076.png)
[Node implements data encryption]

MindSpore:【模型训练】【mindinsight】timeline的时间和实际用时相差很远

M3SDA: Moment matching for multi-source domain adaptation

一文2500字手把手教你配置Jenkins自动化邮件通知

Talking about Contrastive Learning (Contrastive Learning) the first bullet

centos7安装mysql8
随机推荐
Range.CopyFromRecordset method (Excel)
Trial writing C language sanbang
360杜跃进:太空安全风险加剧,需打造一体化防御体系
How architects grow
数据库索引:索引并不是万能药
使用MULTISET来比较数据集的实例介绍
如何优化OpenSumi终端性能?
[Private Series] All kinds of strange problems encountered in daily PHP
The advanced version of the cattle brushing series (search for rotating sorted arrays, inversion of the specified range in the linked list)
历史上的今天:Win10 七周年;微软和雅虎的搜索协议;微软发行 NT 4.0
Tensorflow2.0 confusion matrix does not match printing accuracy
After watching "Second Uncle", I was even more internalized
Centos7 install mysql8
055 c# print
来了!东方甄选为龙江农产品直播带货
These services can't ali interview?Then don't go to, the basic notification, etc
iPhone真是十三香?两代产品完全对比,或许上一代更值得买
MySQL eight-part text recitation version
【MindSpore1.2.0-rc1产品】num_workers问题
青蛙跳台阶(递归和非递归)-------小乐乐走台阶