Socket
Socket
Sign inDemoInstall

ks-vcode

Package Overview
Dependencies
10
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ks-vcode

验证码输入


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

ks-vcode

vue 插件, 验证码输入

安装

  npm i -D ks-vcode

使用

main.js

  import Vue from 'Vue'
  import vcode from 'ks-vcode'
  Vue.use(vcode)

app.vue

<template>
  <v-code mode="both" :len="4" @change="vcodeChange" @complete="vcodeComplete"></v-code>
</template>
<script>
export default {
  data () {
    return {}
  },
  methods: {
    vcodeChange(code, index) {
      console.log("vcodeChange", code, index)
    },
    vcodeComplete(code) {
      console.log("vcodeComplete", code)
    }
  }
}
</script> 

Props

prop类型取值说明
lennumber-验证码长度
groupClassstring-验证码父容器class
modestringnumber,letter,mix,all输入模式,支持 数字/字母/混合/所有字符

Events

事件参数说明
change(code: string[], index: number)输入内容改变时触发. code:已输入的验证码, index:当前输入的验证码在code中的索引
complete(code: string[])输入完成时触发. code:已输入的验证码

Keywords

FAQs

Last updated on 29 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc