Options / Data

<html>
<head>
    <meta charset="UTF-8">
    <title>VueJs Tutorial - coligo</title>
</head>    
<body>
    <div id="vue-instance">
        input box: <input type="text" v-model="greeting"/> <br>
        text area: <input type="textarea" v-model="areadetexto"/>
    </div>
    <script src="https://cdn.jsdelivr.net/vue/2.1.6/vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#vue-instance',
            data: {
                greeting: 'Saudações!',
                areadetexto: 'Essa é uma textarea'
            }
        });
    </script>
</body>
</html>

You can think of the v-model directive as any other HTML attribute. It creates 2-way data bindings on form input elements such as <input>, <textarea>, and <select>. The value of the v-model directive is the data we wish to update on user input events.

results matching ""

    No results matching ""