1.0.6 • Published 5 years ago

vue-pay-input v1.0.6

Weekly downloads
47
License
-
Repository
github
Last release
5 years ago

vue-pay-input

Description

Demo https://5yojky3vr4.codesandbox.io/

Install

Terminal

$ npm i vue-pay-input --save

Usage

  //main.js
   import payInput from 'vue-pay-input'
   Vue.use(payInput)
<template>
  <div >
     <payInput ref="payInput" @change="change" :styles="styles" payItem="pay-item" v-model="value" :type="type" :len="6"></payInput>
  </div>
</template>
<script>
  export default {
      data() {
        return {
            value: "",
            styles:'merge',
            type:'password'
        };
    },
    components: {
    },
    methods: {
        clear() {
            this.$refs.payInput.clear();
        },
        change(val) {
            console.log(`输入的值:${val}`);
        },
        focus() {
            this.$refs.payInput.focus();
        },
        blur() {
            this.$refs.payInput.blur();
        },
        show(){
          this.type=='password'?this.type='text':this.type='password'
        },
         stylefun(){
            this.styles=='separate'?this.styles='merge':this.styles='separate'
        }
    }
  }
</script>

Prop

NameTypeDefaultDescription
lennumber4input value length 输入框的长度
valuestring''default input value v-model绑定值
typestringpassword'password' or 'text' 是否显示输入内容
stylesstringseparate'separate' or 'merge' 风格选择

API

NameDescription
changeinput change

Event

NameDescription
clearclear input
focusfocus event
blurblur event

Devlopment

$ npm install
$ npm run dev
1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago