0.1.5 • Published 8 months ago

sx-vue3-keyboard v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

sx-vue3-keyboard

Vue 手机 密码键盘

install

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

引入插件

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

基本用法

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: 数字、字母、字符键盘;Stringnum
length密码的位数,4 位密码 6 位密码 18 位以内的密码Number6
ref获取当前实例ref-
encrypt加密方式,ras、md5 加密方式, ras 时必须传公钥 publicKeyString
public-key公钥,encrypt="rsa"时必传String
private-key私钥,公钥加密后使用 privateKey 私钥解密(测试加密用)String

Event

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

alt 属性文本

0.1.5

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago