only-number-input
TypeScript icon, indicating that this package has built-in type declarations

1.1.8 • Public • Published

使用教程

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>

Readme

Keywords

none

Package Sidebar

Install

npm i only-number-input

Weekly Downloads

2

Version

1.1.8

License

none

Unpacked Size

410 kB

Total Files

5

Last publish

Collaborators

  • wupeng123321