Appearance
InputAffix
- InputText 와 다른 컴포넌트, 아이콘을 조합형으로 사용할 수 있습니다
- InputGroup 와 다른점은 InputText 의 보더를 표시하지 않고 부모 노드의 보더를 표시합니다
prefix(icon) + suffix(icon)
vue
<script setup lang="ts">
import { ref } from 'vue';
import {
InputAffix,
InputText,
SvgIcon,
ICON_TYPE,
} from '@jennifersoft/vue-components-v2';
const textValue1 = ref('');
</script>
<template>
<div class="w-80">
<input-affix>
<svg-icon :icon="ICON_TYPE.search" />
<input-text v-model="textValue1" :placeholder="'jennifersoft'" />
<svg-icon :icon="ICON_TYPE.help" />
</input-affix>
</div>
</template>Props
| Prop | 타입 | 필수 | 기본값 | 설명 |
|---|---|---|---|---|
invalid | boolean | - | false | 에러 스타일 표시 |
readonly | boolean | - | false | 읽기 전용 |
size | 'large' | 'medium' | 'small' | - | - | 컴포넌트 크기 |
disabled | boolean | - | false | 비활성화 여부 |
prefix(icon) + suffix(icon) + label
vue
<script setup lang="ts">
import { ref } from 'vue';
import {
InputAffix,
InputText,
SvgIcon,
ICON_TYPE,
} from '@jennifersoft/vue-components-v2';
const textValue1 = ref('');
</script>
<template>
<div class="w-80">
<label class="text-xs block">Label</label>
<input-affix>
<svg-icon :icon="ICON_TYPE.search" />
<input-text v-model="textValue1" :placeholder="'input text'" />
<svg-icon :icon="ICON_TYPE.help" />
</input-affix>
<label class="text-xs block">Please enter a guide description</label>
</div>
</template>When invalid
ms
vue
<script setup lang="ts">
import { ref } from 'vue';
import {
InputAffix,
InputText,
SvgIcon,
ICON_TYPE,
} from '@jennifersoft/vue-components-v2';
const textValue1 = ref('');
const invalid = ref(true);
</script>
<template>
<div class="w-80">
<label class="text-xs block">Label</label>
<input-affix :invalid="invalid">
<svg-icon :icon="ICON_TYPE.search" />
<input-text v-model="textValue1" :placeholder="'input text'" />
<span style="margin-right: 6px;">ms</span>
<svg-icon
:icon="ICON_TYPE.caution3"
style="color: var(--red-700)"
/>
</input-affix>
<label class="text-xs block text-[--red-800]"
>Please enter a guide description</label
>
</div>
</template>