0.0.10 • Published 3 years ago

box-verify-code v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

验证码输入框组件

未输入样式

图片1

Focus样式

图片2

GIF

图片3

NPM

npm install box-verify-code --save
yarn add box-verify-code

import

import VerifyCodeField from 'box-verify-code';
import 'box-verify-code/dist/index.css';
export default {
  components:{ VerifyCodeField }
}
<template>
  <VerifyCodeField placeholder="请输入验证码"/>
</template>

API

export default {
  props: {
    //格子数量
    size: {
      type: Number,
      default: 6,
    },
    //placeholder,最好和size长度相同
    placeholder: {
      type: String,
    },
    //只读
    readonly: {
      type: Boolean,
      default: false,
    },
    //禁用
    disabled: {
      type: Boolean,
      default: false,
    },
    //校验规则
    rules: {
      type: Array,
      default: function () {
        return [];
      },
    },
    //验证码的值,支持v-model:value使用
    value: {
      type: String,
    },
    //验证码是否通过rules校验,支持v-model:is-validate使用,未通过的下方会有error文字
    isValidate: {
      type: Boolean,
    },
  },
  emits: ["update:value", "update:is-validate"],
}

Versions

0.0.2:

  • 引入tailwindcss来处理样式
0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago