vue表单域修饰符
number:转化为数值
<input type="text" v-model.number="age"> <script src="../js/vue.js"></script> <script> var vm = new Vue({ el: '#app', data: { age: '' } }) </script>
trim:去掉开始和结尾的空格
<input type="text" v-model.trim="msg"> <script src="../js/vue.js"></script> <script> var vm = new Vue({ el: '#app', data: { msg: 'li' } }) </script>
lazy:将input时间切换为change事件(表单失去焦点后触发)
<input type="text" v-model.lazy="msg"> <script src="../js/vue.js"></script> <script> var vm = new Vue({ el: '#app', data: { msg: 'li' } }) </script>