🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

global-tool

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

global-tool

一个开源的前端工具类函数库

latest
npmnpm
Version
0.0.8
Version published
Weekly downloads
21
250%
Maintainers
1
Weekly downloads
 
Created
Source

vue-pay-keyboard

A Vue component to pay-keyboard 一个虚拟数字支付键盘插件

vue插件开发与发布

安装

npm install global-tool -S

使用

// ES6 main.js 全局使用组件
import vuePayKeyboard from 'global-tool'

Vue.use(vuePayKeyboard)

// 组件内使用
import {vuePayKeyboard} from 'global-tool'

components{
    'vue-pay-keyboard':vuePayKeyboard
}

配置

   <vue-pay-keyboard
   ref="pay"
   :is-pay='isPay'
   @pas-end='pasEnd'
   @close='isPay=false'>
    <!-- 自定义支付动画 -->
      <div slot="loading-ani">
        <svg></svg>
      </div>
    </vue-pay-keyboard>
methods:{
    pasEnd(val) {
      console.log(val);  //得到密码 可能会进行一些加密动作
      setTimeout(() => { // 模拟请求接口验证密码中 ..
        if (val === '111111') { // 密码正确
          this.$refs.pay.$payStatus(true) // 拿到子组件的事件
        } else {
          this.$refs.pay.$payStatus(false)
        }
      }, 1000)
    }
}

Props

nameDescriptiontypedefault
highlight-color点击时高亮颜色String#000
pas-digits密码位数Number6
is-pay显示键盘Booleanfalse
pay-title支付标题String请输入支付密码

Slots 支持自定义插槽

nameDescriptiontypedefault
loading-ani支付请求中loading
pay-status支付成功或者失败支付成功

Events

nameDescription
pas-end密码输入完毕后触发事件,接收所输密码
close关闭键盘

FAQs

Package last updated on 22 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts