# verify-input-code

> 基于vue2.0+的验证码输入组件

Latest version **1.0.1** (published 2017-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install verify-input-code
pnpm add verify-input-code
yarn add verify-input-code
bun add verify-input-code
```

## 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.1 |
| Published | 2017-12-08 |
| First published | 2017-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | xiaoyaoge |
| Maintainers | heting |
| Keywords | vue, input, code, input-code, vrify-idcard-code |

## Links

- npm: https://www.npmjs.com/package/verify-input-code
- Repository: https://github.com/xiaoyaoge/verify-input-code
- Homepage: https://github.com/xiaoyaoge/verify-input-code#readme
- Issues: https://github.com/xiaoyaoge/verify-input-code/issues
- npm.io page: https://npm.io/package/verify-input-code

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-12-08

## README

# verify-input-code

## 基于Vue2.0+的移动端验证码输入组件.


## 功能预览

+ 输入时回调
+ 结果回调
+ 自定义错误处理
+ 自定义验证码个数
+ 样式可控
+ 可以清空输入的验证码


## 基于

基于 Vue.js 2.0+.

## 安装和使用

```javascript
npm i verify-input-code --save
```

- 作为全局组件使用

```javascript
//在项目入口文件
import Vue from 'vue';
import VerifyInputCode from 'verify-input-code';
Vue.component('verifyInputCode', verifyInputCode)
```

- 作为局部组件

```javascript
//在某个组件中
import VerifyinputCode from 'verify-input-code'
export default {
  components: {
    VerifyinputCode
  }
}
```


## API

| 参数    | 类型    | 说明   |  可选值 | 默认值 |
| ------------- |-------| -----| ----| -------|
| code | 数组 | 用户输入的验证码数组 | — | — |
|initInput | 函数 | 给父组件调用初始化输入框 | — | - |
| type | 字符串 | 用户输入类型 当type为idcard时 number值为 18 | number,text,idcard | number |
| upper-case | Boolean | 类型为text的时候可调整输入的字符串为大写 | true,false | false |
| get-input | 函数 | 用户每次输入后的回调函数,接受一个验证码字符串 | — | — |
| success | 函数 | 用户输入完成后的回调函数,接受一个验证码字符串 | — | — |
| error | 函数 | 用户输入不是预期的值的回调函数,接收一个错误的值,若返回true则不清除错误值并继续下一个输入,默认返回false | — | — |
| span-size | 字符串 | 输入后的字体显示大小 | — | 20px |
| span-color | 字符串 | 输入后的字体显示颜色 | — | #f35252 |
| input-size | 字符串 | 输入框的字体显示大小 | — | 20px |
| input-color | 字符串 | 输入框的字体显示颜色 | — | #000 |
| number | 数字 | 验证码个数 | — | 6 |
| height | 字符串 | 整个框的显示高度 | — | 60px |

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