export default { methods: { // 校验 只能输入数字和小数点 fpNumInput(e, str) { const o = e.target const inputRule = /[^\d.]/g //修改inputRule 的值 this.$nextTick(() => { this[str].price = o.value.replace(inputRule, '') }) }, // 校验 只能输入数字 NumberInput(e, str) { const o = e.target const inputRule = /[^\d]/g //修改inputRule 的值 this.$nextTick(() => { this[str].number = o.value.replace(inputRule, '') }) }, } }