본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Input

원문 보기 위키 갱신

Input (인풋)

수많은 해 전에는 입력이라고 하면 천공 카드(punched cards)였어요. 지금은 이 컴포넌트 한 장으로 텍스트 입력을 다루죠.

출처: 문서

본문

Demos

basic.vue
size.vue
round.vue
icon.vue
loading.vue
password.vue
disabled.vue
clearable.vue
autosize.vue
pair.vue
input-group.vue
passively-activated.vue
count.vue
focus.vue
event.vue
input-props.vue
status.vue
pattern.vue
graphemes.vue

API

Input Props

이름 타입 기본값 설명 버전
allow-input (value: string) => boolean undefined 들어오는 값을 검사해요. false를 반환하면 입력이 받아들여지지 않아요. 2.30.4
autofocus boolean false 자동으로 포커스를 맞출지 여부예요.
autosize boolean | { minRows?: number, maxRows?: number } false input이 textarea 타입일 때의 크기 속성이에요. 예: { minRows: 1, maxRows: 3 }.
clearable boolean false 인풋을 지울 수 있는지 여부예요.
count-graphemes (value: string) => number undefined 입력 값의 그래펨(grapheme)을 세어요. 이 값을 지정하면 네이티브 maxlength와 minlength는 사용되지 않아요. 2.34.0
default-value string | [string, string] | null null 수동으로 지정하지 않았을 때의 기본 값이에요.
disabled boolean false 인풋을 비활성화할지 여부예요.
input-props InputHTMLAttributes | TextareaHTMLAttributes undefined 컴포넌트 내부 input 요소의 DOM props예요. pair 속성이 true면 이 기능은 비활성화돼요. 사용 가능한 속성은 여기를 참고하세요. 경고: 같은 이름의 내부 props를 덮어쓰지 않아요(type은 예외예요).
loading boolean undefined 로딩 상태를 설정해요. 이 값을 지정하면(true/false) 로딩 인디케이터를 위한 공간이 항상 확보돼요.
maxlength number undefined 입력 가능한 최대 길이예요.
minlength number undefined 입력해야 하는 최소 길이예요.
pair boolean false 쌍(pair) 형태의 인풋을 사용할지 여부예요.
passively-activated boolean false 인풋을 수동적으로(passively) 활성화할지 여부예요.
placeholder string | [string, string] undefined 인풋의 플레이스홀더예요. pair가 true일 때는 배열이에요.
readonly boolean false 읽기 전용 상태로 설정해요.
render-count (props: { value: string }) => void undefined 글자 수를 렌더링하는 함수예요. 2.32.2
round boolean false 둥근(rounded) 인풋 스타일을 사용해요.
rows number 3 input이 textarea 타입일 때의 rows 속성이에요.
separator string undefined 쌍(pair) 인풋 사이의 구분자예요.
show-count boolean false 글자 수를 표시할지 여부예요.
show-password-on 'click' | 'mousedown' undefined 비밀번호를 보여주는 이벤트예요.
size 'tiny' | 'small' | 'medium' | 'large' 'medium' 인풋의 크기예요.
status 'success' | 'warning' | 'error' undefined 유효성 검사 상태예요. 2.25.0
type 'text' | 'password' | 'textarea' 'text' 인풋의 타입이에요.
value string | [string, string] | null undefined 인풋 값을 수동으로 설정해요. pair가 true일 때는 배열이에요.
on-blur () => void undefined 인풋이 블러될 때 발생하는 콜백이에요.
on-change (value: string | [string, string]) => void undefined 네이티브 change 이벤트가 발생했을 때 호출되는 콜백이에요.
on-clear () => void undefined 인풋이 지워졌을 때 발생하는 콜백이에요.
on-focus () => void undefined 인풋에 포커스가 맞춰졌을 때 발생하는 콜백이에요.
on-input (value: string | [string, string]) => void undefined 인풋이 사용자 입력을 받을 때 발생하는 콜백이에요.
on-update:value (value: string | [string, string]) => void undefined 인풋 값이 바뀔 때 발생하는 콜백이에요.

Input Slots

이름 파라미터 설명 버전
clear-icon () 커스텀 지우기 아이콘이에요. 2.29.0
count (props: { value: string }) 글자 수예요.
password-invisible-icon () 비밀번호가 가려져 있을 때의 토글 아이콘이에요. 2.27.0
password-visible-icon () 비밀번호가 보이는 상태일 때의 토글 아이콘이에요. 2.27.0
prefix () prefix 콘텐츠 슬롯이에요.
separator () 인풋의 구분자 콘텐츠예요. pair가 true일 때만 동작해요. 이 슬롯이 separator 속성보다 우선순위가 높아요.
suffix () suffix 콘텐츠 슬롯이에요.

InputGroup Slots

이름 파라미터 설명
default () 인풋 그룹의 콘텐츠예요.

InputGroupLabel Slots

이름 파라미터 설명
default () 인풋 그룹 label의 콘텐츠예요.

Input Methods

이름 타입 설명 버전
blur () => void input 요소를 블러 처리해요.
clear () => void 인풋 값을 지워요. 2.37.0
focus () => void input 요소에 포커스를 맞춰요.
scrollTo (options: { left?: number, top?: number, behavior?: 'auto' | 'smooth' }) => void 특정 위치로 스크롤해요. 2.32.0
select () => void input 요소를 선택해요.

더 알아보기 (Learn more)

숫자 전용 입력이 필요하면 Input Number 컴포넌트가, 여러 줄 편집은 type='textarea'와 autosize 조합으로 처리해요. 값 검증은 Form 문서의 규칙과 함께 보면 좋아요.