1.1.8 • Published 2 years ago

only-number-input v1.1.8

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

使用教程

npm install only-number-input
// 再main.js 项目入口文件中进行使用
import OnlyNumberInput from 'only-number-input'
const app = crateApp()
app.use(OnlyNumberInput)

Props 配置 也可直接使用el-input的所有属性和方法

参数说明类型默认值
argOptions可选项传入正则表达式/^\d\,/g 只能输入数字和英文逗号Object{maxLength: 2,reg: /^\d/g}

再组件中进行使用

<template>
<OnlyNumberInput :argOptions="{maxLength:4,reg: /[^\d\,]/g}" />
</template>


<script setup lang="ts">
import {ref Ref} from 'vue'

const obj = ref({
  maxLength: 3,
  reg: /[^\d\,]/g
})
</script>