GithubHelp home page GithubHelp logo

hhy5277 / vue-pay-keyboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yucccc/vue-pay-keyboard

0.0 1.0 0.0 472 KB

⌨️ 一个vue手机虚拟支付数字键盘插件

HTML 5.15% Vue 79.92% JavaScript 14.93%

vue-pay-keyboard's Introduction

vue-pay-keyboard

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

vue插件开发与发布�

demo演示

demo

安装

npm install vue-pay-keyboard -S

使用

// ES6
import vuePayKeyboard from 'vue-pay-keyboard.js'
// require
var vuePayKeyboard = require('PayKeyboard')

Vue.use(vuePayKeyboard)

// 或者直接使用script导入
<script src="./node_modules/vue/dist/vue-pay-keyboard.js"></script>

// 作为组件的方式使用
<vue-pay-keyboard></vue-pay-keyboard>

配置

   <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

name Description type default
highlight-color 点击时高亮颜色 String #000
pas-digits 密码位数 Number 6
is-pay 显示键盘 Boolean false
pay-title 支付标题 String 请输入支付密码

Slots 支持自定义插槽

name Description type default
loading-ani 支付请求中 loading
pay-status 支付成功或者失败 支付成功

Events

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

vue-pay-keyboard's People

Contributors

yucccc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.