Input (输入框)

文本输入框(v-model),带标签、辅助 / 错误文本与尺寸。

基础用法

Helper text below the field.

Basic.vue

尺寸

Sizes.vue

状态

This field is required.

States.vue

可清除与密码

Clearable.vue

前后缀

带前缀图标

$
USD

带后缀单位

Affix.vue

属性

属性类型默认值说明
autofocusbooleanfalseFocus the field on mount. Focus is moved with `preventScroll`, so it never jogs the page: an autofocused input inside a popover is at the document origin until Floating UI has positioned it, and letting the browser scroll to it there threw the page to the top.
classNamestring""
colorKunUIColor"default"
darkBorderbooleantrueLegacy dark-mode border toggle.
descriptionstring""Helper text below the field (hidden when `error` is set). Canonical name.
disabledbooleanfalse
errorstring""
helperTextstring""Helper text below the field.
isClearablebooleanfalseShow an X button to clear the value when non-empty.
isInvalidbooleanfalseMark the field invalid (danger ring) without showing an error message.
labelstring""
modelValuestring | number""
placeholderstring""
requiredbooleanfalse
revealPasswordbooleanfalseFor type="password": render an eye toggle to reveal/hide the value.
roundedKunUIRounded
sizeKunUISize"md"
typestring"text"

事件

事件回调参数
blurevent: FocusEvent
clear
focusevent: FocusEvent
update:modelValuevalue: string | number

插槽

插槽作用域
#prefix
#suffix