Vue起步_Vue实例生命周期

生命周期函数就是Vue实例在某一个时间点会自动执行的函数。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="E:\Code\Vue\assets\js\vue.js"></script>
</head>
<body>
    <div id="app">hello world</div>

    <script>
        var vm =new Vue({
            el: '#app',
            beforeCreate: function() {
                console.log("beforeCreated");
            },
            created: function() {
                console.log("created");
            }
        })
    </script>
</body>
</html>



猜你喜欢

转载自blog.csdn.net/qq_17832583/article/details/80398021