feat: add InputGroup and verify shared field integration
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
FieldError,
|
||||
InputGroup,
|
||||
InputGroupInput,
|
||||
InputGroupPrefix,
|
||||
InputGroupSuffix,
|
||||
Label,
|
||||
TextField,
|
||||
} from "@heroui-vue/components";
|
||||
import { IconMail } from "@tabler/icons-vue";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col gap-4">
|
||||
<TextField class="w-full max-w-[280px]" is-invalid is-required name="email">
|
||||
<Label>邮箱地址</Label>
|
||||
<InputGroup>
|
||||
<InputGroupPrefix>
|
||||
<IconMail class="size-4 text-muted" aria-hidden="true" />
|
||||
</InputGroupPrefix>
|
||||
<InputGroupInput
|
||||
class="w-full max-w-[280px]"
|
||||
placeholder="name@email.com"
|
||||
/>
|
||||
</InputGroup>
|
||||
<FieldError>请输入有效的邮箱地址</FieldError>
|
||||
</TextField>
|
||||
<TextField class="w-full max-w-[280px]" is-invalid is-required name="price">
|
||||
<Label>设置价格</Label>
|
||||
<InputGroup>
|
||||
<InputGroupPrefix>$</InputGroupPrefix>
|
||||
<InputGroupInput
|
||||
class="w-full max-w-[200px]"
|
||||
placeholder="0"
|
||||
type="number"
|
||||
/>
|
||||
<InputGroupSuffix>USD</InputGroupSuffix>
|
||||
</InputGroup>
|
||||
<FieldError>价格必须大于 0</FieldError>
|
||||
</TextField>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user