Giter Site home page Giter Site logo

magic-coder / vue-number-keyboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yujinjin/vue-number-keyboard

0.0 1.0 0.0 67 KB

vue-number-keyboard是基于VUE实现的数字键盘插件,当前支持整数、小数数字输入、乱序键盘,demo中给出了常用的验证码、金额数字示例。数字键盘的大小包括字体尺寸支持响应式。

Home Page: https://yujinjin.github.io/vue-number-keyboard/

JavaScript 63.47% HTML 9.31% Vue 27.22%

vue-number-keyboard's Introduction

vue-number-keyboard

vue-number-keyboard是基于VUE实现的数字键盘插件,当前支持整数、小数数字输入、乱序键盘,demo中给出了常用的验证码、金额数字示例。数字键盘的大小包括字体尺寸支持响应式。

查看DEMO

运行项目

clone项目到本地,进入项目文件夹,安装依赖

git clone https://github.com/yujinjin/vue-number-keyboard.git
cd loading
npm install

运行demo,会自动打开浏览器地址运行

npm run demo

编译打包项目

npm run compile

NPM

npm install vue-number-keyboard

依赖

  • VUE

使用

作为插件

import Vue from 'vue'
import numberKeyboard from 'vue-number-keyboard'
import "vue-number-keyboard/dist/vue-number-keyboard.css"

// VUE use
Vue.use(numberKeyboard);

可配置属性选项

名称 描述 默认值 可选项
value 双向绑定值,用于显示或隐藏数字键盘 false Boolean
disorder 数字键盘是否乱序,常用于密码输入 false Boolean
styleName 数字键盘风格 'popular' simple(无确认键和小数点,一般用于密码或验证码输入)、popular(有确认键和小数点,一般用于价格或金额输入)
confirmText 键盘确认键文案 '确定' String
isInteger 是否是整数 false Boolean

示例

1. 货币金额
<number-keyboard v-model="isShowAmountKeyboard" @delete="withdrawAmount ? (withdrawAmount = withdrawAmount.substring(0, withdrawAmount.length - 1)) : ''" @keyDown="withdrawAmountInput"></number-keyboard>

示例:

image

2. 验证码
<number-keyboard :isInteger="true" @confirm="save" v-model="isShowVerificationCodeKeyboard" @keyDown="verificationCodeInput" @delete="validateCode ? (validateCode = validateCode.substring(0, validateCode.length - 1)) : ''"></number-keyboard>

示例:

image

3. 密码输入(数字乱序)
<number-keyboard :isInteger="true" :disorder="true" v-model="isShowPasswordKeyboard" @keyDown="passwordInput" @delete="password ? (validateCode = password.substring(0, password.length - 1)) : ''"></number-keyboard>

示例:

image

最后

  • 如果喜欢一定要 star哈!!!(谢谢!!)

  • 如果有意见和问题 请在 lssues提出,我会在线解答。

vue-number-keyboard's People

Contributors

yujinjin 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.