<tap-pin-code>
PIN 码 / 验证码(OTP)输入组件。专为移动端设计的定长字符分格输入框,支持短信验证码、动态令牌、支付密码等场景,内置透明 Input 层支持原生移动端输入、短信自动填充与掩码模式。
Example
Loading...
<tap-pin-code .length=${6} @change=${(evt) => (evt.target.value = evt.detail)}></tap-pin-code> <tap-pin-code
.length=${4}
.mask=${true}
@change=${(evt) => (evt.target.value = evt.detail)}></tap-pin-code> <tap-pin-code
.length=${6}
.variant=${"joint"}
.mask=${true}
@change=${(evt) => (evt.target.value = evt.detail)}></tap-pin-code> <tap-pin-code
.length=${4}
.variant=${"underline"}
@change=${(evt) => (evt.target.value = evt.detail)}></tap-pin-code> <tap-pin-code
.length=${4}
.error=${true}
.value=${"1234"}></tap-pin-code> <tap-pin-code
.length=${4}
.disabled=${true}
.value=${"12"}></tap-pin-code>
API
Shadow DOM; Extends GemElement
Instance Properties
| Property(Attribute) | Reactive | Type |
|---|---|---|
change |
Emitter<string> |
|
submit |
Emitter<string> |
|
value(value) |
Yes | string |
type(type) |
Yes | 'number' | 'alphanumeric' | 'text' |
variant(variant) |
Yes | 'box' | 'underline' | 'joint' |
mask(mask) |
Yes | string |
placeholder(placeholder) |
Yes | string |
length(length) |
Yes | number |
autofocus(autofocus) |
Yes | boolean |
disabled(disabled) |
Yes | boolean |
readonly(readonly) |
Yes | boolean |
error(error) |
Yes | boolean |
disableAutocommit(disable-autocommit) |
Yes | boolean |
Instance Methods
| Method | Type |
|---|---|
focus |
(options?: FocusOptions) => void |
blur |
() => void |
clear |
() => void |
Other
| Type | Value |
|---|---|
| Event | change, submit |
| Part | cell, active-cell, input, dot, caret |
