标签:不可 details ber func 整理 directive tar type listener
参见前辈整理的: https://blog.csdn.net/u013243347/article/details/81181058
<input type="number" placeholder="请输入" v-number-only v-model="SaleQty" v-on:click.stop.prevent>
directives: { // v-number-only numberOnly: { bind: function(el) { el.handler = function() { el.value = el.value.replace(/\D+/, ‘‘) } el.addEventListener(‘input‘, el.handler) }, unbind: function(el) { el.removeEventListener(‘input‘, el.handler) } } },
Vue 限制input输入 限数字 或 小数点后两位number
标签:不可 details ber func 整理 directive tar type listener
原文地址:https://www.cnblogs.com/xiangsj/p/9425033.html