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 ...
随机推荐
- 关于View端
View--------------Request 1 URL vs n View 同一个URL可以对应多个View, HTML(通过Request请求获得) 例如SAO项目中的step1--> ...
- [CSS] Introduction to CSS Columns
Learn how to use CSS columns to quickly lay out fluid columns that are responsive, degrade gracefull ...
- 用SecureCRT来上传和下载数据
借助securtCRT,使用linux命令sz可以很方便的将服务器上的文件下载到本地,使用rz命令则是把本地文件上传到服务器. 其中,对于sz和rz的理解与记忆我用了如下的方法(很多时候容易搞混): ...
- Trace、Debug和TraceSource的使用以及日志设计 .
[-] Trace 和 Debug区别 什么是Listeners 跟踪开关 使用BooleanSwitch开关 使用TraceSwitch开关 使用TraceSource代替Trace和Debug 设 ...
- 关于Android WindowManager显示悬浮窗的动画效果
要实现WindowManager添加的窗口,实现动画显示,就需要添加如下红色的属性,其他的添加View只要设置其Animations属性也会实现动画,当然自己实现也可,但是能直接用系统的已经实现好的, ...
- SQL Server数据库自增字段正确的插入值的描述
我们今天主要向大家讲述的是SQL Server数据库之向SQL Server自增字段正确的插入值的实际操作步骤,在一般的情况下,我们不能向 SQL Server 数据库自增字段中插入值,如果非要这么干 ...
- IIS错误日志:Failed to execute request because the App-Domain
装上IIS和.net2.0框架后,打开ASP.NET站点,出现Server Application Error,出先此问题,一般先看系统的“事件管理器”,于是查看服务器的“事件管理器”中的“应用程序” ...
- 在xml文件中写入&符号时需要对其进行转义
如:在xml文件中保存这样的测试文件: <?xml version="1.0" encoding="utf-8"?> <datas> & ...
- ListView的addAll方法
add是将传入的参数作为当前List中的一个Item存储,即使你传入一个List也只会另当前的List增加1个元素addAll是传入一个List,将此List中的所有元素加入到当前List中,也就是当 ...
- [WinForm] VS2010的程序打包封装
因为学习的要求,我需要把自己的程序进行打包封装,开始也是苦恼,没有找到很好的办法,但并没有放弃,终于发现了一个差不多的文章,于是摸索着进行,可喜的是是成功了,下面和大家分享一下. 第一步:前提是你已经 ...