Textarea
Textarea는 여러 줄의 글을 입력받는 요소입니다. 주로 메모, 설명, 문의 내용처럼 길어질 수 있는 내용을 받을 때 사용됩니다. 글자 수 제한을 두면 입력한 글자 수를 함께 보여 주어 사용자가 남은 분량을 확인하며 작성할 수 있습니다.
State
Code
vue
<script setup>
import { ref } from 'vue'
import { ATextarea } from '@mobigen/rnd-design-system'
const message = ref('')
</script>
<template>
<ATextarea v-model="message" label="Default" placeholder="Type your message here." />
<ATextarea v-model="message" label="Note" :rows="6" maxlength="100" hint="100자까지 입력할 수 있습니다." />
</template>Props
| 속성 | 값 |
|---|---|
modelValue | String |
label | String |
ariaLabel | String |
id | String |
placeholder | String |
disabled | true, false |
error | String |
hint | String |
required | true, false |
rows | Number, String |
name, maxlength 같은 속성은 입력 요소에 그대로 전달된다.
Events
| 이벤트 | 전달 값 |
|---|---|
update:modelValue | String |
Methods
| 이름 | 설명 |
|---|---|
focus() | <textarea>에 포커스를 준다. 템플릿 ref로 호출한다. |