UNPKG

@yeepay/virtual-keyboard

Version:

YeePay Virtual Keyboard Component

70 lines (55 loc) 1.82 kB
# Vue 2.7.16 ## Introduction 虚拟键盘组件 ## Installation ```shell npm install @yeepay/virtual-keyboard ``` ## Usage ### Global ```js import YeepayKeyboard from '@yeepay/virtual-keyboard' import Vue from 'vue' import '@yeepay/virtual-keyboard/dist/index.css' Vue.use(YeepayKeyboard) ``` ### Local ```vue <template> <div> <YeepayKeyboard style="width: 400px;" :max-length="12" algorithms="RSA2048" @confirm="handleConfirm" /> </div> </template> ``` ```js import { YeepayKeyboard } from '@yeepay/virtual-keyboard' export default { components: { YeepayKeyboard }, data() { return { value: '' } }, methods: { handleConfirm(value) { this.value = value // {raw: 'xxxxx'} } } } ``` ## Options | 参数 | 说明 | 类型 | 默认值 | | ---------- | --------------------------------------------------------------------------------- | ------ | ------------------------------ | | algorithms | 键盘算法 'SM2', 'RSA2048' | string | 'RSA2048' | | max-length | 最大输入长度 | number | 12 | | scene | 键盘类型 'pc', 'mobile' | string | 'pc' | | placement | 弹窗位置 'bottom-start', 'bottom-end', 'top-start', 'top-end',只有 pc 场景下有效 | string | 'bottom-end' | | zIndex | Number | 2010 | 键盘的 z-index 值,最小值 2010 |