Skip to content

PasswordInput 密码输入框 ​

密码输入框组件,基于 Vant PasswordInput + NumberKeyboard + Field 组件实现。

类型标识 ​

  • t: 'password-input'

额外 Props ​

属性名类型默认值描述
passwordInputPropsPartial<PasswordInputProps>-VanPasswordInput 组件的属性
passwordInputOnobject{}VanPasswordInput 组件的事件
numberKeyboardPropsPartial<NumberKeyboardProps>-VanNumberKeyboard 组件的属性
numberKeyboardOnobject{}VanNumberKeyboard 组件的事件
numberKeyboardSlotsobject-VanNumberKeyboard 组件的插槽
isLinkbooleantrue是否展示右侧箭头并开启点击反馈
onRowClick(option, ev) => void-点击事件,传递此事件时会忽略内部打开弹窗操作

Slots ​

支持所有 CommonSlots 插槽。

示例 ​

基础用法 ​

typescript
const formConfig = defineOption([
    {
        field: 'payPassword',
        t: 'password-input',
        label: '支付密码',
        placeholder: '点击输入支付密码',
        passwordInputProps: {
            length: 6,
            gutter: 10,
        },
    },
]);

自定义密码框样式 ​

typescript
const formConfig = defineOption([
    {
        field: 'password',
        t: 'password-input',
        label: '密码',
        passwordInputProps: {
            length: 4,
            gutter: 8,
            mask: true,
            focused: false,
        },
        numberKeyboardProps: {
            theme: 'custom',
            extraKey: '.',
        },
    },
]);