mand-mobile/components/captcha
xuxiaoyan e0876fbb76 doc: update 2019-01-04 17:34:12 +08:00
..
demo example(captcha): fix demo verify captcha too fast 2018-12-17 10:52:42 +08:00
test test: update snapshots 2019-01-04 16:56:32 +08:00
README.en-US.md doc: update 2019-01-04 17:34:12 +08:00
README.md doc: update 2019-01-04 17:34:12 +08:00
component.js feat(code clean up): 2018-09-24 15:48:57 +08:00
index.vue fix(captcha): remove clearing code in setError 2018-12-17 17:20:12 +08:00

README.en-US.md

title preview
Captcha https://mand-mobile.github.io/2x-doc/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-countdown start the countdown automatically, otherwise need to manually call countdown Boolean true
title - String -
brief - String -
append-to portal node of dialog HTML Element document.body
count counter duration, set as 0 to hide resend button Number 60
count-normal-text text of send verification code button String 发送验证码
count-active-text text of send verification code button in countdown state String {$1}秒后重发

Captcha Methods

countdown()

Start the time counter

resetcount()

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