# sx-vue3-keyboard

> Vue 手机 密码键盘

Latest version **0.1.5** (published 2023-09-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install sx-vue3-keyboard
pnpm add sx-vue3-keyboard
yarn add sx-vue3-keyboard
bun add sx-vue3-keyboard
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2023-09-05 |
| First published | 2023-09-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 3.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | fang_yp@suixingpay.com |
| Maintainers | fangyp |
| Keywords | keyboard, password |

## Links

- npm: https://www.npmjs.com/package/sx-vue3-keyboard
- Repository: https://github.com/fangyp/sx-vue-keyboard
- Homepage: https://github.com/fangyp/sx-vue-keyboard#readme
- Issues: https://github.com/fangyp/sx-vue-keyboard/issues
- npm.io page: https://npm.io/package/sx-vue3-keyboard

## Dependencies (4)

- [vue](https://npm.io/package/vue.md) ^3.2.13
- [core-js](https://npm.io/package/core-js.md) ^3.8.3
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.1.1
- [jsencrypt](https://npm.io/package/jsencrypt.md) ^3.3.2

## Recent versions

- 0.1.5 (latest) — 2023-09-05
- 0.1.4 — 2023-09-05
- 0.1.3 — 2023-09-05
- 0.1.2 — 2023-09-05
- 0.1.1 — 2023-09-05
- 0.1.0 — 2023-09-05

## README

# sx-vue3-keyboard

Vue 手机 密码键盘

## install

```
yarn add sx-vue3-keyboard
or
npm i sx-vue3-keyboard
```

#### 引入插件

```javascript
import SxKeyboard from 'sx-vue3-keyboard';
import 'sx-vue3-keyboard/keyboard.css';
createApp(App).use(SxKeyboard).mount('#app');
```

#### 基本用法

```javascript
import { ref } from 'vue';
const keyboardRef = ref(null);

// 打开键盘
keyboardRef.value.show();
// 关闭键盘
keyboardRef.value.hide();

<sx-keyboard
ref="keyboardRef"
type="letter"
length="6"
encrypt="md5"
public-key=""
private-key=""
@complete="onFinish"
/>;

const onFinish = (value) => {
  console.log('密码 ===', value)
}
```

### API

| 参数        | 说明                                                       | 类型   | 默认值 |
| ----------- | :--------------------------------------------------------- | :----- | :----: |
| type        | 键盘类型，num: 纯数字键盘； letter: 数字、字母、字符键盘； | String |  num   |
| length      | 密码的位数，4 位密码 6 位密码 18 位以内的密码              | Number |   6    |
| ref         | 获取当前实例                                               | ref    |   -    |
| encrypt     | 加密方式，ras、md5 加密方式, ras 时必须传公钥 publicKey    | String |        |
| public-key  | 公钥，encrypt="rsa"时必传                                  | String |        |
| private-key | 私钥，公钥加密后使用 privateKey 私钥解密（测试加密用）     | String |        |

### Event

| 事件名   | 说明                 | 参数 |
| :------- | :------------------- | :--- |
| complete | 密码输入完成后的回调 | -    |

![alt 属性文本](https://beunc.oss-cn-beijing.aliyuncs.com/github/demo.png)

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