zoukankan      html  css  js  c++  java
  • Vue 钩子函数

    Vue 钩子函数

    Vue.component('Test', {
      props: {
        name: String
      },
      template: `<div class="test">{{ name }}</div>`,
      beforeCreate() {
        console.log('Test beforeCreate');
      },
      created() {
        console.log('Test created');
      },
      mounted() {
        console.log('Test mounted');
      },
      beforeDestroy() {
        console.log('Test beforeDestroy');
      },
      destroyed() {
        console.log('Test destroyed');
      },
      beforeUpdate() {
        console.log('Test beforeUpdate');
      },
      updated() {
        console.log('Test updated');
      }
    });
    
    Vue.component('Test1', {
      props: {
        name: String
      },
      template: '<div class="test1"><slot />{{ name }}</div>',
      beforeCreate() {
        console.log('Test1 beforeCreate');
      },
      created() {
        console.log('Test1 created');
      },
      mounted() {
        console.log('Test1 mounted');
      },
      beforeDestroy() {
        console.log('Test1 beforeDestroy');
      },
      destroyed() {
        console.log('Test1 destroyed');
      },
      beforeUpdate() {
        console.log('Test1 beforeUpdate');
      },
      updated() {
        console.log('Test1 updated');
      }
    });
  • 相关阅读:
    jQuery之Ajax应用
    ELK安装配置简单使用
    saltstack其他运行模式
    saltstack syndic安装配置使用
    salt api
    saltstack api安装使用
    saltstack master minion安装配置简单使用
    zabbix api
    zabbix snmp、jmx配置使用
    phoenix安装
  • 原文地址:https://www.cnblogs.com/nelsonlei/p/12844602.html
Copyright © 2011-2022 走看看