vue study notes: Hello Vue

Write simple example, under the understanding of basic grammar

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8 ">
    <style>

    </style>
</head>
<body>
    <div id="app">
        {{message}}
    </div>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                message: "Hello Vue !"
            },
        });
    </script>
</body>
</html>

In the above code inside, where js script creates a Vue objects, which el-top this option Vue object management element id

In app element, a {{message}}mode reference variable value defined in vue instance in the attribute data, and displayed

Guess you like

Origin www.cnblogs.com/wbyixx/p/11931447.html