zoukankan      html  css  js  c++  java
  • 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 EventDescription
    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.
  • 相关阅读:
    JVM简单入门
    10 张图聊聊线程的生命周期和常用 APIs
    Spring Cloud实战 | 最八篇:Spring Cloud +Spring Security OAuth2+ Axios前后端分离模式下无感刷新实现JWT续期
    ueditor 插入视频代码解析
    CentOS下添加新硬盘并分区格式化的详细步骤
    Java 8 stream
    crontab命令详解
    计算机网络自顶向下学习杂记
    nginx安装
    js识别PC和H5
  • 原文地址:https://www.cnblogs.com/viola-sh/p/5704265.html
Copyright © 2011-2022 走看看