mand-mobile/components/captcha
moyuboy c202a3c32b fix(captcha): counter reset 2018-04-24 23:27:21 +08:00
..
demo example(captcha): update 2018-04-24 22:50:09 +08:00
test test: Improve unit test cases 2018-04-23 17:33:32 +08:00
README.md feat(captcha): optimize events stream 2018-04-24 22:49:00 +08:00
component.js Initial commit 2018-03-26 16:04:04 +08:00
index.vue fix(captcha): counter reset 2018-04-24 23:27:21 +08:00

README.md

title preview
Captcha 验证码 https://didi.github.io/mand-mobile/examples/#/captcha

验证码校验窗口

引入

import { Captcha } from 'mand-mobile'

Vue.component(Captcha.name, Captcha)

代码演示

API

Captcha Props

属性 说明 类型 默认值
v-model 验证码窗口是否显示 Boolean false
is-view 是否内嵌在页面内展示,否则以弹层形式 Boolean false
maxlength 字符最大输入长度, 若为-1则不限制输入长度 Number 4
mask 是否掩码 Boolean false
system 是否使用系统默认键盘 Boolean false
title 窗口标题 String -
appendTo 挂载节点 HTMLElement document.body
count 倒计时时长, 设置为0的时候不显示倒计时按钮 Number 60

Captcha Methods

countdown()

手动重置倒计时

setError(message)

设置报错信息并显示

Captcha Events

@show()

验证码组件显示事件

@hide()

验证码组件隐藏事件

@send()

发送验证码事件, 点击重发按钮后触发及开始倒计时

@submit(code)

用户提交输入内容事件