<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="../assets/js/vue.js"></script>
    <title>构造器的声明周期</title>
</head>
<body>
    <h1>构造器的声明周期</h1>
    <hr>
    <div id="app">
        {{message}}
        <p><button @click="jia">加分</button></p>
    </div>
        <button onclick="app.$destroy()">销毁</button>
 
    <script type="text/javascript">
        var app=new Vue({
            el:'#app',
            data:{
                message:1
            },
            methods:{
                jia:function(){
                    this.message ++;
                }
            },
            beforeCreate:function(){
                console.log('1-beforeCreate 初始化之后');
            },
            created:function(){
                console.log('2-created 创建完成');
            },
            beforeMount:function(){
                console.log('3-beforeMount 挂载之前');
            },
            mounted:function(){
                console.log('4-mounted 被创建');
            },
            beforeUpdate:function(){
                console.log('5-beforeUpdate 数据更新前');
            },
            updated:function(){
                console.log('6-updated 被更新后');
            },
            activated:function(){
                console.log('7-activated');
            },
            deactivated:function(){
                console.log('8-deactivated');
            },
            beforeDestroy:function(){
                console.log('9-beforeDestroy 销毁之前');
            },
            destroyed:function(){
                console.log('10-destroyed 销毁之后')
            }
 
        })
    </script>
</body>
</html>

最新文章

  1. [BZOJ3211]花神游历各国(线段树+区间开根)
  2. 侧滑菜单SlidingMenu
  3. QT 信号与槽connect
  4. [转] PHP计算两个坐标之间的距离, Calculate the Distance Between Two Points in PHP
  5. Eclipse中为自己写完的函数添加注释(快捷键ALT+SHIFT+J)
  6. Elasticsearch 相关名词理解
  7. BZOJ 2054 疯狂的馒头
  8. CSS 实现:两栏布局(一边固定,一边自适应)
  9. JS通用方法总结(一)
  10. Some_problem_with_octopress
  11. &lt;转载&gt;DIV+CSS position定位方法总结
  12. 整理了一份React-Native学习指南
  13. LeetCode-Best Time to Buy and Sell Stock III[dp]
  14. VS2005工程的Device右边内容为空问题
  15. Android开发学习总结(二)——使用Android Studio搭建Android集成开发环境
  16. 防止xss攻击。
  17. Cocos Creator 计时器的延时循环试用方法
  18. CS229 6.13 Neurons Networks Implements of stack autoencoder
  19. ActiveMQ实战之 Queue点对点消息
  20. 【转】mybatis连接Oracle做增删改查

热门文章

  1. POI 怎么设置Excel整列的CellStyle啊
  2. 【BZOJ1925】 [SDOI2010] 地精部落(带有一堆性质的动态规划)
  3. gearmand 编译 could not find gperf
  4. Problem I: Satellite Photographs
  5. matlab中size函数总结
  6. 如何修改魔兽争霸war3分辨率
  7. 3_HA介绍和安装部署
  8. js点击拉拽轮播图pc端移动端适配
  9. lrzsz包中的rz和sz命令
  10. vim正则表达式的替换变量