v-model指令及其修饰符
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div id="app"> <div> <input type="text" v-model="name"> <pre><h2>{{name}}</h2></pre> </div> <div> <input type="text" v-model.lazy="name"> <pre><h2>{{name}}</h2></pre> </div> <div> <input type="text" v-model.trim="name"> <pre><h2>{{name}}</h2></pre> </div> </div> <script src="../lib/vue.js"></script> <script src="js/main.js"></script> </body> </html>
var app = new Vue(
{
el:"#app",
data:{
name:""
},
methods:{
}
}
)
本文来自博客园,作者:一石数字欠我15w!!!,转载请注明原文链接:https://www.cnblogs.com/52-qq/p/8386264.html