mand-mobile/components/captcha
moyus b47ed2f1a4 fix: portal bugs 2018-04-18 15:05:47 +08:00
..
demo example(captcha): add error message 2018-04-11 15:25:03 +08:00
test Initial commit 2018-03-26 16:04:04 +08:00
README.md feat(captcha): add error message 2018-04-11 15:22:40 +08:00
component.js Initial commit 2018-03-26 16:04:04 +08:00
index.vue fix: portal bugs 2018-04-18 15:05:47 +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(countdown)

触发发送验证码事件, 会在第一次显示的时候触发, 其余情况则会在点击重发按钮后出发

@submit(code)

用户提交输入内容事件