当前位置:网站首页>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
}
}
边栏推荐
- 【MindSpore】用coco2017训练Model_zoo上的 yolov4,迭代了两千多batch_size之后报错,大佬们帮忙看看。
- MindSpore:ImageFolderDataset数据读取问题
- Linux download and install mysql5.7 version tutorial the most complete and detailed explanation
- How to build FTP server under win2003
- Day31 LeetCode
- Cesium loads offline maps and offline terrain
- The JDBC programming of the MySQL database
- linux下mysql8安装
- Difference between Object and Map
- 【MindSpore1.2.0-rc1产品】num_workers问题
猜你喜欢
MySQL eight-part text recitation version
Golang logging library zerolog use record
MySQL database --- Addition, deletion, modification and query of MySQL tables (advanced)
Mac安装PHP开发环境
历史上的今天:Win10 七周年;微软和雅虎的搜索协议;微软发行 NT 4.0
MindSpore:【语音识别】DFCNN网络训练loss不收敛
LeetCode 0952.按公因数计算最大组件大小:建图 / 并查集
MySQL八股文背诵版
VBA runtime error '-2147217900 (80040e14): Automation error
LeetCode 0952. Calculate Maximum Component Size by Common Factor: Mapping / Union Search
随机推荐
[PyTorchVideo Tutorial 01] Quickly implement video action recognition
How to build FTP server under win2003
ImportError: attempted relative import with no known parent package
【MindSpore】多卡训练保存权重问题
MySQL大批量造数据
Typora设置标题自动标号
Linux下安装Mysql5.7,超详细完整教程,以及云mysql连接
MySQl数据库————DQL数据查询语言
Correct pose of Vulkan open feature
MySQL Functions (Classic Collection)
Linux下载安装mysql5.7版本教程最全详解
MySQL database --- Addition, deletion, modification and query of MySQL tables (advanced)
MindSpore:数据处理问题
MySQL八股文背诵版
看完《二舅》,我更内耗了
试写C语言三子棋
Talking about Contrastive Learning (Contrastive Learning) the first bullet
【无标题】多集嵌套集合使不再有MultipleBagFetchException
技术很牛逼,还需要“向上管理”吗?
Snowflake vs. Redshift的2022战报:两个数据平台谁更适合你?