vue3-code-input
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

vue3-code-input

vue3 验证码输入框

image

使用

<script setup>
import { VerificationInput } from 'vue3-code-input';

function handleChange(code: string) {
  console.log(code);
}
</script>
<template>
  <VerificationInput @change="handleChange"></VerificationInput>
</template>

样式可以自由覆盖。

参数

props desc type default required
step 验证码个数 number 6 -
autofocus 原生属性 boolean false -
disabled 是否禁用 boolean false -
inputFormatter 格式化输入值 (t: string) => string 仅允许数字和字母 -

事件

events desc type
change 输入内容改变 (value: string) => void

Package Sidebar

Install

npm i vue3-code-input

Weekly Downloads

31

Version

1.1.5

License

MIT

Unpacked Size

10.7 kB

Total Files

6

Last publish

Collaborators

  • chym123