<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>vue</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.js"></script>
</head>
<body>
<div id="app">
<input type="text" v-model.lazy="name">
//v-model.trim 去掉空格
//v-model.number 去掉空格 不用number会变成字符串'10' 用了变成数字10
{{name}}
</div>
<script src="app.js"></script>
</body>
</html>
var app = new Vue({
el:'#app',
data:{
name:'liuwei',
price:10,
},
methods:{
}
});
网友评论