Files
heroui-vue/apps/docs/demos/number-field-with-chevrons.vue
T

42 lines
1.2 KiB
Vue

<script setup lang="ts">
import {
Label,
NumberField,
NumberFieldDecrementButton,
NumberFieldGroup,
NumberFieldIncrementButton,
NumberFieldInput,
} from "@heroui-vue/components";
import { IconChevronUp, IconChevronDown } from "@tabler/icons-vue";
</script>
<template>
<NumberField
class="w-full max-w-64"
:defaultValue="99"
:minValue="0"
name="amount"
:formatOptions="{
currency: 'EUR',
currencySign: 'accounting',
style: 'currency',
}"
>
<Label>带 Chevron 的数字输入框</Label>
<NumberFieldGroup class="flex">
<NumberFieldInput class="flex-1" />
<div class="flex h-full flex-col border-s border-field-placeholder/15">
<NumberFieldIncrementButton
class="flex h-1/2 w-6 items-center justify-center rounded-none border-0 pt-0.5 text-sm"
>
<IconChevronUp :size="11" aria-hidden="true" />
</NumberFieldIncrementButton>
<NumberFieldDecrementButton
class="flex h-1/2 w-6 items-center justify-center rounded-none border-0 pb-0.5 text-sm"
>
<IconChevronDown :size="11" aria-hidden="true" />
</NumberFieldDecrementButton>
</div>
</NumberFieldGroup>
</NumberField>
</template>