# sms-code-input

> SMS code input component for Vue2

Latest version **1.0.7** (published 2024-04-03) · MIT license · 0 weekly downloads

## Install

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

## 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.7 |
| Published | 2024-04-03 |
| First published | 2024-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 455.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mr.Z |
| Maintainers | mizhon |
| Keywords | vue, vue2, vuejs, sms, code input, components |

## Links

- npm: https://www.npmjs.com/package/sms-code-input
- Repository: https://github.com/zdesign-ui/sms-code-input
- Issues: https://github.com/zdesign-ui/sms-code-input/issues
- npm.io page: https://npm.io/package/sms-code-input

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [core-js](https://npm.io/package/core-js.md) ^3.6.5

## Recent versions

- 1.0.7 (latest) — 2024-04-03
- 1.0.6 — 2024-04-03
- 1.0.5 — 2024-04-01
- 1.0.4 — 2024-04-01
- 1.0.3 — 2024-04-01
- 1.0.2 — 2024-03-29
- 1.0.1 — 2024-03-28
- 1.0.0 — 2024-03-26
- 0.1.0 — 2024-03-26

## README

# SMS-CODE-INPUT
> SMS code input component for Vue2 

 [![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/)
 [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/zdesign-ui/sms-code-input.git)
 [![npm](https://img.shields.io/npm/v/sms-code-input.svg)](https://www.npmjs.com/package/sms-code-input)

 sms-code-input is a dependency-free, lightweight vue component that can be overwrited by yourself.

## Usage

When you use it, you need to wrapper this component by an exact size container or element. (e.g: use <code>div</code> with definitely width)

### step-1
```
vue create demo
```
### step-2
```
cd demo
npm install sms-code-input
```

## Example
```
npm run serve
```
```vue
<template>
  <div style="width: 300px">
    <sms-code-input 
      :digits="counts"
      :color="color"
      :styles="styles"
      @change="onInputChange" 
      @complete="onInputComplete"
    >
    </sms-code-input>
  </div>
</template>
<script>
export default {
  data() {
    return {
      counts: 4,
      color: '#409eff',
      styles: {
        height: '50px',
        width: '30px',
        fontSize: '20px',
        color: '#275edb'
      }
    }
  },
  methods: {
    onInputChange(val) {
      console.log('input change: --->', val)
    },
    onInputComplete(val) {
      console.log('input complete: --->', val)
    }
  }
}
</script>
```

### Options
|    Property    |    Description   |   type   |	default	|
| -----------------  | ---------------- | :--------: | :----------: |
| digits         | the code numbers for the SMS  |Number| 6 |
| color          | the input border color  |String| '#af3737' |
| styles         | the custom styles for the input |Object | {} |

### Functions
|    Function Name   |    Description   |
| -----------------  | ---------------- |
| change             | trigger when input code changed   |
| complete           | tirgger when input code completed |

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