• vue生命周期


    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="/node_modules/vue/dist/vue.js"></script>
        <title>Document</title>
    </head>
    <body>
        <div id="vueapp">
            {{msg}}
        </div>
        <script>
            vm=new Vue({
                el:"#vueapp",
                data:{
                    msg:"0"
                },
                methods: {
                    
                },
                beforeCreate() {
                    console.log("初始化之后,数据监听之前",this.msg);
                },
                created() {
                    var that=this;
                    console.log("初始化之后,数据监听之后,dom元素产生之前",this.msg,that.$el);
                },
                beforeMount() {
                    var that=this;
                    console.log("初始化之后,数据监听之后,dom元素产生之后,数据未被渲染",that.$el);
                },
                mounted() {
                    var that=this;
                    console.log("初始化之后,数据监听之后,dom元素产生之后,数据以被渲染",that.$el);
                },
            });
        </script>
    </body>
    </html>

  • 相关阅读:
    使用ab进行页面的压力测试
    apache http server2.2 + tomcat5.5 性能调优
    php Try Catch多层级异常测试
    用flask实现的添加后保留原url搜索条件
    会议室预定设计
    day4
    day3
    day2
    day1
    redis介绍以及安装
  • 原文地址:https://www.cnblogs.com/hcyesdo/p/13380717.html
Copyright © 2020-2023  润新知