zoukankan      html  css  js  c++  java
  • Vue核心技术 Vue+Vue-Router+Vuex+SSR实战精讲

     慕课网视频地址(正版购买):https://coding.imooc.com/class/196.html

    import Vue from 'vue'
    
    const app = new Vue({
      // el: '#root',
      // template: '<div>{{text}}</div>',
      data: {
        text: 0
      },
      beforeCreate () {
        console.log(this.$el, 'beforeCreate')
      },
      created () {
        console.log(this.$el, 'created')
      },
      beforeMount () {
        console.log(this.$el, 'beforeMount')
      },
      mounted () {
        console.log(this.$el, 'mounted')
      },
      beforeUpdate () {
        console.log(this, 'beforeUpdate')
      },
      updated () {
        console.log(this, 'updated')
      },
      activated () { // 在组件章节讲解
        console.log(this, 'activated')
      },
      deactivated () { // 在组件章节讲解
        console.log(this, 'deactivated')
      },
      beforeDestroy () {
        console.log(this, 'beforeDestroy')
      },
      destroyed () {
        console.log(this, 'destroyed')
      },
      render (h) {
        throw new TypeError('render error')
        // console.log('render function invoked')
        // return h('div', {}, this.text)
      },
      renderError (h, err) {
        return h('div', {}, err.stack)
      },
      errorCaptured () {
        // 会向上冒泡,并且正式环境可以使用
      }
    })
    
    app.$mount('#root')
    // setInterval(() => {
    //   app.text = app.text += 1
    // }, 1000)
    
    setTimeout(() => {
      // 解除所有的事件监听和watch
      app.$destroy()
    }, 1000)

    欢迎关注公众号,留言交流。

    如非软弱,怎会连触手可及的幸福也要放弃?--纵力量绵薄,也要筑起通往梦想的桥梁!


    据说星星比较有用:https://github.com/zxyuns/bluemoon
  • 相关阅读:
    90. 子集 II 回溯算法
    47. 全排列 II 回溯算法
    40. 组合总和 II
    39. 组合总和 回溯
    NLP 第八课 语言技术-文本与LDA主题模型
    36. 有效的数独
    31. 下一个排列
    HDU 4527
    HDU 4521
    HDU 5191
  • 原文地址:https://www.cnblogs.com/zxyun/p/14455229.html
Copyright © 2011-2022 走看看