zoukankan      html  css  js  c++  java
  • vue的生命周期

    vue实例生命周期
    支持vue实例的生命周期如下:
    beforeCreate
    created
    beforeMount
    mounted

    beforeUpdate
    updated
    activated


    页面生命周期
    不论是app还是小程序,生命周期是非常重要的知识点
    onLoad 监听页面加载
    onShow 监听页面显示
    onReady 监听页面初次渲染完成
    onHide 监听页面隐藏
    onUnload 监听页面卸载

    onPullDownRefresh 监听用户下拉动作
    onReachBottom 页面上拉触底事件的处理函数
    onShareAppMessage 用户点击右上角分享
    onPageScroll 监听页面滚动
    onTabItemTap 当前是tab页时
    file

    file

    setTimeout(function(){
    
    },3000);
    

    file

    file

    file

    file

    file

    file
    class

    <view :class="{ active: isActive }">111</view>
    
    <view class="static" v-bind:class="{active: isActive, 'text-danger': hasError}">222</view>
    
    <view class="static" :class="[activeClass, errorClass]">333</view>
    
    <view class="static" v-bind:class="[isActive ? activeClass : ' ', errorClass]">444</view>
    
    <view class="static" v-bind:class="[{active: isActive}, errorClass]">555</view>
    

    style:

    <view v-bind:style="{color : activeColor, fontSize: fontSize + 'px' }">666</view>
    
    <view v-bind:style="[{color: activeColor, fontSize: fontSize+'px'}]">777</view>
    

    file

    <template>
     <scroll-view class="menus">
      <view v-for="(menu, index) in menus" :class="[index == currentIndex ? 'menuActive' : ' ' ]"> {{ menu }} </view>
     </scroll-view>
    </template>
    

    file


    若本号内容有做得不到位的地方(比如:涉及版权或其他问题),请及时联系我们进行整改即可,会在第一时间进行处理。


    请点赞!因为你们的赞同/鼓励是我写作的最大动力!

    欢迎关注达叔小生的简书!

    这是一个有质量,有态度的博客

    博客

  • 相关阅读:
    CodeForces 906D (欧拉降幂)
    洛谷4139 bzoj 3884 上帝与集合的正确用法
    The Preliminary Contest for ICPC Asia Nanjing 2019ICPC南京网络赛
    主席树之初见
    HDU 6709“Fishing Master”(贪心+优先级队列)
    [数论]拓展中国剩余定理
    [数论] 求逆元
    2019 年百度之星·程序设计大赛
    2019 年百度之星·程序设计大赛
    pb_ds中的hash_table
  • 原文地址:https://www.cnblogs.com/dashucoding/p/11639218.html
Copyright © 2011-2022 走看看