ionic中的生命周期函数
//ionic中的生命周期函数
onPageLoaded(){ //page初始化时
console.log("page 1 : page loaded");
}
//在这里可以做页面初始化的一些事情
onPageWillEnter(){ //page即将进入时
console.log("page 1 : page will enter");
}
onPageDidEnter(){ //page进入后
console.log("page 1 : page did enter");
}
onPageWillLeave(){ //page即将离开
console.log("page 1 : page will leave");
}
onPageDidLeave(){ //page离开后
console.log("page 1 : page did leave");
}
onPageWillUnload(){
//从DOM中移除时候执行的生命周期,不常用
console.log("")
}
onPageDidUnload(){
//DOM中移除执行完成的时候,不常用
}
ionic v2中新的周期函数
| Page Event | Description |
|---|---|
ionViewLoaded |
Runs when the page has loaded. This event only happens once per page being created and added to the DOM. If a page leaves but is cached, then this event will not fire again on a subsequent viewing. The ionViewLoaded event is good place to put your setup code for the page. |
ionViewWillEnter |
Runs when the page is about to enter and become the active page. |
ionViewDidEnter |
Runs when the page has fully entered and is now the active page. This event will fire, whether it was the first load or a cached page. |
ionViewWillLeave |
Runs when the page is about to leave and no longer be the active page. |
ionViewDidLeave |
Runs when the page has finished leaving and is no longer the active page. |
ionViewWillUnload |
Runs when the page is about to be destroyed and have its elements removed. |
ionViewDidUnload |
Runs after the page has been destroyed and its elements have been removed. |
ionic中的生命周期函数的更多相关文章
- Angular 中的生命周期函数
一. Angular中的生命周期函数 官方文档:https://www.angular.cn/guide/lifecycle-hooks 生命周期函数通俗的讲就是组件创建.组件更新.组件销毁的时候会触 ...
- Unity3D中的生命周期函数
生命周期函数:需要继承 MonoBehaviour 类才能使用.生命周期函数全部都是由系统定义好的,系统会自动调用,且调用顺序和我们在代码里面的书写顺序无关. 常用的生命周期函数: Awake():唤 ...
- React中的生命周期函数
React的生命周期函数 什么是生命周期函数:生命周期函数是指在某一个时刻组件会自动调用执行的函数 Initialization:初始化 执行Constructor,初始state和props Mou ...
- flutter中的生命周期函数
前言:生命周期是一个组件加载到卸载的整个周期,熟悉生命周期可以让我们在合适的时机做该做的事情,flutter中的State生命周期和android以及React Native的生命周期类似. 先看一张 ...
- ionic生命周期函数
Ionic4中的生命周期函数和angualr7基本是一样的,下面我们看看Ionic4中的生命周期函数,以及生命周期函数的用法. Ionic4中内置的生命周期函数: ionViewWillEnter — ...
- React的生命周期函数
概述 在React中,生命周期函数指的是组件在某一个时刻会自动执行的函数 constructor 在类或组件创建的时候被自动执行,我们可以说它是生命周期函数,但它并不是React所特有的,所有的Es6 ...
- Activity系列讲解---三大基本状态与七大生命周期函数
简介:四大组件之一,在应用中一个Activity可以用来表示一个界面,可以理解为用户可视化界面,一个android应用必须通过Activity来运行和启动. 1.三大基本状态与七大生命周期函数 2.代 ...
- Cocos2d-x场景生命周期函数介绍
层(Layer)的生命周期函数有如下: init().初始化层调用. onEnter().进入层时候调用. onEnterTransitionDidFinish().进入层而且过渡动画结束时候调用. ...
- UIViewCotroller 的生命周期函数
Viewcontroller 的所有生命周期函数 重写时 一定要先写 父类 方法 就是(super +生命周期函数) LoadView ViewDidLoad ViewDidUnload: 在iOS ...
随机推荐
- 【JavsScript】转载---如何成为优秀的前端
题记 做好前端 关于离职 如何成为优秀的前端 书籍推荐 博客推荐 源码阅读 去面试 14年计划 招聘信息 题记 四月前,低迷.失志踌躇不前形容自己再好不过,中途来了一次彻底的醒悟,于是我发现自己变得勤 ...
- input text框和 checkbox 连带被选中的情况
<html> <head></head> <body> <ul> <li><input type="checkb ...
- iOS 2D绘图详解(Quartz 2D)之Bitmap
什么是Bitmap? Bitmap叫做位图,每一个像素点由1-32bit组成.每个像素点包括多个颜色组件和一个Alpha组件(例如:RGBA). iOS中指出如下格式的图片 JPEG, GIF, PN ...
- Android Task 与 Back Stack
Tasks and Back Stack 一个应用通常包括多个 activity.每个 activity应用设计为围绕针对执行用户特定的行为和可以启动其它 activity. 一个 Activity也 ...
- C++ SFINAE
1. 什么是SFINAE 在C++中有很多的编程技巧(Trick), SFINAE就是其中一种, 他的全义可以翻译为”匹配失败并不是一个错误(Substitution failure is not a ...
- THD 变量存入threads中
http://blog.csdn.net/gapaul/article/details/12047497 http://ourmysql.com/archives/930
- Linux 下五个顶级的开源命令行 Shell
这个世界上有两种 Linux 用户:敢于冒险的和态度谨慎的. 其中一类用户总是本能的去尝试任何能够戳中其痛点的新选择.他们尝试过不计其数的窗口管理器.系统发行版和几乎所有能找到的桌面插件. 另一类用户 ...
- UIView的生命周期
一. 大体流程: (loadView/nib)文件来加载view到内存-->viewDidLoad函数进一步初始化这些view-->内存不足时, 调用viewDidUnload函数释放vi ...
- [翻译] CBStoreHouseTransition
CBStoreHouseTransition What is it? A custom transition inspired by Storehouse iOS app, also support ...
- 【开源项目3】Android快速开源框架--afinal
Afinal简介 Afinal 是一个android的sqlite orm 和 ioc 框架.同时封装了android中的http框架,使其更加简单易用: 使用finalBitmap,无需考虑bitm ...