v-model - two-way data binding

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

    <div id="app">
        <h1>{{greeting}}</h1>
        <input type="text" v-model="greeting">
    </div>


    <script src="./vue.js"></script>
    <script>

       
        const app = new Vue({
            el: '#app',
            data: {
                greeting: 'Hello Vuejs'
            }
        });



    </script>
</body>

</html>
Published 151 original articles · won praise 1 · views 1881

Guess you like

Origin blog.csdn.net/qq_45802159/article/details/103816313