mand-mobile/components/captcha
xuxiaoyan ec88e6f701 doc:add a version number identifier for new features 2018-06-28 00:21:08 +08:00
..
demo site&example:add default title to examples & update docs 2018-06-21 11:34:49 +08:00
test test: Improve unit test cases 2018-04-23 17:33:32 +08:00
README.en-US.md doc:add a version number identifier for new features 2018-06-28 00:21:08 +08:00
README.md doc:add a version number identifier for new features 2018-06-28 00:21:08 +08:00
component.js Initial commit 2018-03-26 16:04:04 +08:00
index.vue style:update theme related stylus variables 2018-06-08 13:40:47 +08:00

README.en-US.md

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

SMS code confirming dialog

Import

import { Captcha } from 'mand-mobile'

Vue.component(Captcha.name, Captcha)

Code Examples

API

Captcha Props

Props Description Type Default
v-model whether to show captcha or not Boolean false
is-view whether to show as inline element or append to the body Boolean false
maxlength maxlength of string, set to -1 as no restriction Number 4
mask whether to mask code or not Boolean false
system Use system keyboard or simulated keyboard Boolean false
auto-countdown1.3.0+ start the countdown automatically, otherwise need to manually call countdown Boolean true
title title of captcha String -
append-to portal node of dialog HTML Element document.body
count counter duration, set as 0 to hide resend button Number 60
countNormalText1.3.0+ text of send verification code button String 发送验证码
countActiveText1.3.0+ text of send verification code button in countdown state String {$1}秒后重发

Captcha Methods

countdown()

Manually reset the time counter

setError(message)

Set and show error message

Captcha Events

@show()

Invoked when captcha is shown

@hide()

Invoked when captcha is hidden

@send(countdown)

Invoked when user clicks resend button. The first time you open or click the reissue button triggers and starts the countdown. If auto-countdown is false, you need to manually call countdown.

@submit(code)

Invoked when user submits