Giter VIP home page Giter VIP logo

vue-payinput's Introduction

vue-payInput

2017-11-30 Create by wanlixin

基于vue2.0开的一个类似微信支付密码输入的组件

效果如下:

功能描述

  1. 仅支持输入数字且仅6位
  2. 输入字符不可见
  3. 输入密码完毕自动隐藏键盘

实现思路

  1. 先循环出来6个小方格
  2. 同位置放一个同大小的input输入框(其实不同位置,不同大小也可以;如果考虑字母数字混合输入可以使用的password类型)
  3. input type="number"
  4. 利用vue里面 watch 检测输入框内容的长度,处理到6个小方格里面
  5. 隐藏的小黑圆点,采用before伪类实现,减少DOM

vue-payinput's People

Contributors

wanlixi avatar

Watchers

James Cloos avatar  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.