Skip to content
数据录入与表单

NnInputPassword 密码输入框

支持显隐切换的密码输入。

示例

API

Props

名称类型默认值说明
valuestring | number''密码值,配合 v-model:value
placeholderstring''占位文字。
allowClearbooleanfalse显示清除按钮。
statusstring''传给内部 NnInput
disabledbooleanfalse禁用输入和显隐按钮。
readonlybooleanfalse只读输入。
visibilityTogglebooleantrue是否显示密码显隐按钮。
sizestring'middle'传给内部 NnInput
borderedbooleantrue是否显示边框。

未声明的属性会继续通过 NnInput 转发给原生输入元素。

Events

事件参数说明
update:value(value: string)内部输入更新。
input(event)转发 NnInput.input
change(event)转发 NnInput.change
pressEnter(event: KeyboardEvent)转发 Enter。
focus(event: FocusEvent)转发 focus。
blur(event: FocusEvent)转发 blur。
clear(event: MouseEvent)转发清除事件。
visibleChange(visible: boolean)点击显隐按钮后触发。

Expose

名称签名或值说明
inputNnInput 组件引用内部输入组件。
focus(options?: FocusOptions) => void聚焦输入。
blur() => void移除焦点。
select() => void选择全部文本。

密码组件占用内部 suffix 区域作为显隐按钮,没有公开 prefix/suffix 插槽。

Released under the MIT License.