zoukankan      html  css  js  c++  java
  • Vue笔记

    生命周期

      beforeCreate:

        vue实例初始化后执行

        数据被观察前

      created:

        在data observation, computed properties, methods, watch/event callbacks. 之后

      beforeMount:

        ~

      mounted:

        不保证所有的组件都被挂载完毕,如果要保证所有组件挂载完毕,使用 vm.$nextTick 

    mounted() {
      this.$nextTick(function () {
        // Code that will run only after the
        // entire view has been rendered
      })
    }

      beforeUpdate:

        

    watch中 

      deep作用

        数组或者对象改变值之后,vue是不知道的,所以需要 将deep设置为 true,方能监测到。

      immediate:

        页面首次加载立即执行

     watch: {
        colours: {
          // This will let Vue know to look inside the array
          deep: true,
    
          // We have to move our method to a handler field
          handler()
            console.log('The list of colours has changed!');
          }
        }
      }
  • 相关阅读:
    sys模块详解
    os模块详解2
    tyvj 1203 机器分配
    洛谷 P1496 火烧赤壁
    P1204 [USACO1.2]挤牛奶Milking Cows
    bzoj 2120 数颜色
    P2056 采花
    P1972 [SDOI2009]HH的项链
    9.20模拟赛
    P2709 小B的询问
  • 原文地址:https://www.cnblogs.com/xieweikang/p/15345403.html
Copyright © 2011-2022 走看看