当前位置:网站首页>Notes on the 3rd harmonyos training in the studio
Notes on the 3rd harmonyos training in the studio
2022-06-26 03:01:00 【Eternal @ [email protected]】
Catalog
One 、 Directory structure
- Directory structure
- Main concern entry--》src--》main This file
- app.js Files are used for global JavaScript Logic and entire application lifecycle management .
- pages The directory is used to store all component pages .
- common Directory is used to store public resource files , such as : Media resources and JS file .
- i18n The directory is used to configure the content of resources in different language scenes , such as : Apply text entry , Path... Pictures, etc , Be careful i18n Is the development retention folder , Cannot rename .
Two 、 Life cycle
Page Different state transitions in the lifecycle and their corresponding callbacks
- onStart()
When the system was first created Page When an instance , Trigger the callback . For one Page example , The callback is triggered only once during its life cycle , Page After this logic will enter INACTIVE state . Developers have to rewrite the method , And configure the default display here AbilitySlice.
- onActive()
Page Will be entering INACTIVE The status goes to the front desk , Then the system calls the callback .Page After that, enter ACTIVE state , This state is the state in which the application interacts with the user .Page Will remain in this state , Unless something happens that causes Page Lose focus , For example, the user clicks the back button or navigates to other Page. When something like this happens , Will trigger Page go back to INACTIVE state , The system will call onInactive() Callback . thereafter ,Page Maybe back to ACTIVE state , The system will call again onActive() Callback . therefore , Developers often need to implement in pairs onActive() and onInactive(), And in onActive() To obtain in onInactive() The released resources in .
- onStop()
The system is about to be destroyed Page when , This callback function will be triggered , Inform users to release system resources .
3、 ... and 、list Components
Group list :<list-item-group>
Normal list :<list-item>
Four 、 Routing jump
Use router.push, Import the module first
5、 ... and 、swipe Components
Developers just need to focus on the implementation logic , Provide the ability to switch the display of sub components
版权声明
本文为[Eternal @ [email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206260219462224.html
边栏推荐
猜你喜欢
OpenAPI 3.0 specification - Food Guide
【flask入门系列】flask处理请求和处理响应
Interviewer: please name four ways to exchange the values of two variables without using third-party variables
Fresh graduates talk about their graduation stories
使用IDEA画结构图
High availability in Internet three highs (high concurrency, high performance and high availability)
Multi surveyor Gongshu Xiao sir_ The solution of using websocket error reporting under working directory
ORB-SLAM3论文概述
Authorization of database
数据库查询语句SQL中like、%、-的区别
随机推荐
Arthas(阿尔萨斯) 能为你做什么?
数据库的授权
如何在 ggplot2 中删除网格线(附示例)
Analysis and optimization of ue5 global illumination system lumen
R 语言降维的 PCA 与自动编码器
How to add a regression equation to a plot in R
Survival analysis based on ovarian data set
Fresh graduates talk about their graduation stories
【flask入门系列】flask处理请求和处理响应
UTONMOS坚持“藏品、版权”双优原则助力传统文化高质量发展
Teach you to quickly record sounds on PC web pages as audio files
Can the main RF circuit be removed for projects that do not need the main RF?
Thirty ninth step
arduino字符串转16进制数 大彩串口屏用。
Is it safe to open an online stock account?
Lumen Analysis and Optimization of ue5 global Lighting System
请指教同花顺开户选选择哪家券商比较好?网上开户是否安全么?
无法上网问题解决过程
What can Arthas do for you?
Dreamcamera2 video recording, playing without sound, recording function is normal, using a third-party application for video recording, playing with sound