Files
heroui-vue/apps/docs/demos/color-field-invalid.vue
T

28 lines
816 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import {
ColorField,
ColorFieldGroup,
ColorFieldInput,
FieldError,
Label,
} from "@heroui-vue/components";
</script>
<template>
<div class="flex flex-col gap-4">
<ColorField isInvalid isRequired class="w-[280px]" name="color">
<Label>颜色</Label>
<ColorFieldGroup>
<ColorFieldInput placeholder="#000000" />
</ColorFieldGroup>
<FieldError>请输入有效的十六进制颜色</FieldError>
</ColorField>
<ColorField isInvalid class="w-[280px]" name="invalid-color">
<Label>背景色</Label>
<ColorFieldGroup>
<ColorFieldInput default-value="not-a-color" />
</ColorFieldGroup>
<FieldError>颜色格式无效,请使用十六进制(例如 #FF5733)</FieldError>
</ColorField>
</div>
</template>