//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中的生命周期函数的更多相关文章

  1. Angular 中的生命周期函数

    一. Angular中的生命周期函数 官方文档:https://www.angular.cn/guide/lifecycle-hooks 生命周期函数通俗的讲就是组件创建.组件更新.组件销毁的时候会触 ...

  2. Unity3D中的生命周期函数

    生命周期函数:需要继承 MonoBehaviour 类才能使用.生命周期函数全部都是由系统定义好的,系统会自动调用,且调用顺序和我们在代码里面的书写顺序无关. 常用的生命周期函数: Awake():唤 ...

  3. React中的生命周期函数

    React的生命周期函数 什么是生命周期函数:生命周期函数是指在某一个时刻组件会自动调用执行的函数 Initialization:初始化 执行Constructor,初始state和props Mou ...

  4. flutter中的生命周期函数

    前言:生命周期是一个组件加载到卸载的整个周期,熟悉生命周期可以让我们在合适的时机做该做的事情,flutter中的State生命周期和android以及React Native的生命周期类似. 先看一张 ...

  5. ionic生命周期函数

    Ionic4中的生命周期函数和angualr7基本是一样的,下面我们看看Ionic4中的生命周期函数,以及生命周期函数的用法. Ionic4中内置的生命周期函数: ionViewWillEnter — ...

  6. React的生命周期函数

    概述 在React中,生命周期函数指的是组件在某一个时刻会自动执行的函数 constructor 在类或组件创建的时候被自动执行,我们可以说它是生命周期函数,但它并不是React所特有的,所有的Es6 ...

  7. Activity系列讲解---三大基本状态与七大生命周期函数

    简介:四大组件之一,在应用中一个Activity可以用来表示一个界面,可以理解为用户可视化界面,一个android应用必须通过Activity来运行和启动. 1.三大基本状态与七大生命周期函数 2.代 ...

  8. Cocos2d-x场景生命周期函数介绍

    层(Layer)的生命周期函数有如下: init().初始化层调用. onEnter().进入层时候调用. onEnterTransitionDidFinish().进入层而且过渡动画结束时候调用. ...

  9. UIViewCotroller 的生命周期函数

    Viewcontroller 的所有生命周期函数 重写时 一定要先写 父类 方法 就是(super  +生命周期函数) LoadView ViewDidLoad ViewDidUnload: 在iOS ...

随机推荐

  1. linux上一些命令

    ps -ef看看有没有tomcat的进程:也可以用netstat -tnl来看tomcat的端口是否开放

  2. python 操作word文档

    因为工作需要操作一些word文档,记录一下学习思路 #-*- encoding: utf8 -*- import win32com from win32com.client import Dispat ...

  3. DataGridView重绘painting简单实例

    private void dataGridViewX1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { & ...

  4. Find the Clones

    Find the Clones Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 6365   Accepted: 2375 D ...

  5. Clairewd’s message

    Problem Description Clairewd is a member of FBI. After several years concealing in BUPT, she interce ...

  6. solr查询在solrconfig.xml中的配置

    <requestHandler name="/select" class="solr.SearchHandler"> <lst name=&q ...

  7. Android之旅:梦想、学习、坚持、自信、淡定

    前段时间参加了2012年度IT博客大赛,进了前十强,写了一篇获奖感言,不过还没正式在CSDN发表出来.眼看2012年就要结束了,刚好借这个机会将2012年度IT博客大十强获奖感言发表出来,也算是对20 ...

  8. 【python,logging】python中的logging模块

    本文章转自kenby的博客,比较全面易懂,转来留作以后使用. http://kenby.iteye.com/blog/1162698 一.从一个使用场景开始 import logging # 创建一个 ...

  9. Android学习笔记⑧——UI组件的学习AdapterView相关2

    前面都是用ListView控件来配合Adapter做的一些实例,这次我们来见识一下GridView与Adapter之间的爱恨情仇.... GridView是用于在界面上按行.列分布的方式来显示多个的组 ...

  10. 使用PIL处理image

    获得一个Image实例 import Image im = Image.open('1.jpg') #返回一个Image对象,open只对图片的头做处理,所以open操作是非常快的 resize,裁剪 ...