image.png

代码

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据绑定之v-model指定-textarea中应用</title>
    <script src="https://static.gzj2001.com/vue/vue.js"></script>
</head>
<body>
    <div id="app">
        {{info}}
        <!-- 绑定后,info实时刷新 -->
        <input type="text" v-model="info">
        <textarea v-model="info"></textarea>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                ok:true,
                info:"allen",
                age:20
            }
        })
    </script>
</body>
</html>

效果

image.png