VUE -input输入框字母转大写

示例:

输入自动转--->大写

 <input type="text" placeholder="请输入证件号码" maxlength="18" v-model="codeval" >

JS

codeval: 监听输入值
card_id: 更改后的值,程序使用值
data: {
  card_id : ''

},
computed: { codeval: { get:
function () { return this.card_id; }, set: function (val) { this.card_id = val.toUpperCase(); } } }
原文地址:https://www.cnblogs.com/congxueda/p/13632256.html