当前位置:网站首页>工作室第3次HarmonyOS培训笔记
工作室第3次HarmonyOS培训笔记
2022-06-26 02:20:00 【永恒@~@】
目录
一、目录结构
- 目录结构

- 主要关注entry--》src--》main这个文件

- app.js 文件用于全局 JavaScript 逻辑和整个应用生命周期管理。
- pages 目录用于存放所有组件页面。
- common 目录用于存放公共资源文件,比如:媒体资源和 JS 文件。
- i18n 目录用于配置不同语言场景资源内容,比如:应用文本词条,图片路径等资源,注意 i18n 是开发保留文件夹,不可重命名。
二、生命周期
Page 生命周期的不同状态转换及其对应的回调

- onStart()
当系统首次创建 Page 实例时,触发该回调。对于一个 Page 实例,该回调在其生命周期过程中仅触发一次, Page 在该逻辑后将进入 INACTIVE 状态。开发者必须重写该方法,并在此配置默认展示的 AbilitySlice。
- onActive()
Page 会在进入 INACTIVE 状态后来到前台,然后系统调用此回调。Page 在此之后进入 ACTIVE 状态,该状态是应用与用户交互的状态。Page 将保持在此状态,除非某类事件发生导致 Page 失去焦点,比如用户点击返回键或导航到其他 Page。当此类事件发生时,会触发 Page 回到 INACTIVE 状态,系统将调用 onInactive() 回调。此后,Page 可能重新回到 ACTIVE 状态,系统将再次调用 onActive() 回调。因此,开发者通常需要成对实现 onActive()和 onInactive(),并在 onActive() 中获取在 onInactive() 中被释放的资源。
- onStop()
系统将要销毁 Page 时,将会触发此回调函数,通知用户进行系统资源的释放。
三、list组件
分组列表:<list-item-group>
普通列表:<list-item>

四、路由跳转
使用router.push,先导入模块

五、swipe组件
滑动容器,提供切换子组件显示的能力

边栏推荐
- [solution] the blue screen restart problem of the virtual machine started by the VMware of Lenovo Savior
- 无法上网问题解决过程
- Create a nonlinear least squares test in R
- Remember a simple JVM tuning experience
- R language Markov chain Monte Carlo: practical introduction
- Modifying table names, deleting tables, obtaining table information, and deleting table records on specified dates for common MySQL statements
- Implement decorator pattern for servicecollection
- Une citation classique de la nature humaine que vous ne pouvez pas ignorer
- Cox 回归模型
- Chapter I: essential information collection of penetration test
猜你喜欢

Digital commodity DGE -- the dark horse of wealth in digital economy

Termux install openssh

Une citation classique de la nature humaine que vous ne pouvez pas ignorer
![2022-06-25:给定一个正数n, 表示有0~n-1号任务, 给定一个长度为n的数组time,time[i]表示i号任务做完的时间, 给定一个二维数组matrix, matrix[j] = {a,](/img/93/d95255bae20b138851bdc8a50f8647.png)
2022-06-25:给定一个正数n, 表示有0~n-1号任务, 给定一个长度为n的数组time,time[i]表示i号任务做完的时间, 给定一个二维数组matrix, matrix[j] = {a,

财富自由技能:把自己产品化
![[机器翻译]—BLEU值的计算](/img/c3/8f98db33eb0ab5a016621d21d971e4.png)
[机器翻译]—BLEU值的计算
![[solution] the blue screen restart problem of the virtual machine started by the VMware of Lenovo Savior](/img/c3/892ce2f45abea7140df98cabc1431b.png)
[solution] the blue screen restart problem of the virtual machine started by the VMware of Lenovo Savior

无法上网问题解决过程

Interviewer: please name four ways to exchange the values of two variables without using third-party variables

Fresh graduates talk about their graduation stories
随机推荐
Dreamcamera2 video recording, playing without sound, recording function is normal, using a third-party application for video recording, playing with sound
[machine learning] case study of college entrance examination prediction based on multiple time series
在同花顺网上开户安全吗?如何网上开一个券商账户
ORB-SLAM3论文概述
UTONMOS:以数字藏品助力华夏文化传承和数字科技发展
MySQL updates records based on the queried data
WPF window centering & change trigger mechanism
Limit the input character length to 1 character in English and 2 characters in Chinese
Gold three silver four~
Pie chart metamorphosis record, the liver has 3000 words, collection is to learn!
The difference between like,%, - in database query SQL
Can the main RF circuit be removed for projects that do not need the main RF?
How to open a stock account? Is it safe to open an account online?
How do I take a screenshot of the iPad? 7 ways to take quick screenshots of iPad
R language Markov chain Monte Carlo: practical introduction
[solution] the blue screen restart problem of the virtual machine started by the VMware of Lenovo Savior
MySQL根据查询的数据更新记录
How to adjust face input size
[solution] cmake was unable to find a build program corresponding to "UNIX makefiles"
PCA and automatic encoder for dimension reduction of R language

