# v-input-limit

> vue指令-快速实现限制输入框数字类型及数字范围限制

Latest version **1.0.5** (published 2023-05-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install v-input-limit
pnpm add v-input-limit
yarn add v-input-limit
bun add v-input-limit
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-05-31 |
| First published | 2023-02-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Wubo |
| Maintainers | boommax |
| Keywords | vue, directive |

## Links

- npm: https://www.npmjs.com/package/v-input-limit
- Repository: https://github.com/Boom-BO/v-input-limit
- Homepage: https://github.com/Boom-BO/v-input-limit#readme
- Issues: https://github.com/Boom-BO/v-input-limit/issues
- npm.io page: https://npm.io/package/v-input-limit

## Recent versions

- 1.0.5 (latest) — 2023-05-31
- 1.0.4 — 2023-05-31
- 1.0.3 — 2023-02-23
- 1.0.0 — 2023-02-23

## README

# input-limit 输入限制自定义指令

## 使用

### (一)

```bash
npm install v-input-limit -S

or

yarn add v-input-limit -S
```

### （二）

```js
// main.ts
import inputLimit from 'v-input-limit'
Vue.use(inputLimit)
```

::: tip
目前已有以下几种限制方式、后续会不断完善 :cyclone::cyclone::cyclone:
:::

## 一、正整数

```js
<input v-model="" v-input-limit:int />
```

## 一、正整数范围限制

> - 例如：限制 `0 ≤ number < 100` 的正整数

```js
 <input v-model="" v-input-limit:int.range="[0, 99]" />
```

> - 例如：限制 `100 ≤ number` 的正整数

```js
 <input v-model="" v-input-limit:int.range="[100]" />
```

## 一、无限制正小数

```js
<input v-model="" v-input-limit:float />
```

## 一、限制正小数点后 n 位

> - 例如：限制小数点后 1 位的正小数

```js
<input v-model="" v-input-limit:float="1" />
```

## 一、正小数且有范围限制

> - 例如：限制 `0 ≤ number < 100` ，并且保留小数点后两位的小数

```js
 <input v-model="" v-input-limit:float.range="{ decimal: 2, range: [0, 99.99] }" />
```

---
_Source: https://npm.io/package/v-input-limit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
