feat: add InputGroup and verify shared field integration
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import {
|
||||
Button,
|
||||
InputGroup,
|
||||
InputGroupInput,
|
||||
InputGroupSuffix,
|
||||
Label,
|
||||
TextField,
|
||||
} from "@heroui-vue/components";
|
||||
import { IconEye, IconEyeOff } from "@tabler/icons-vue";
|
||||
|
||||
const isVisible = ref(false);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TextField class="w-full max-w-[280px]" name="password">
|
||||
<Label>密码</Label>
|
||||
<InputGroup>
|
||||
<InputGroupInput
|
||||
class="w-full max-w-[280px]"
|
||||
:model-value="isVisible ? '87$2h.3diua' : '••••••••'"
|
||||
:type="isVisible ? 'text' : 'password'"
|
||||
/>
|
||||
<InputGroupSuffix class="pe-0">
|
||||
<Button
|
||||
is-icon-only
|
||||
:aria-label="isVisible ? '隐藏密码' : '显示密码'"
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
@click="isVisible = !isVisible"
|
||||
>
|
||||
<IconEyeOff v-if="isVisible" class="size-4" aria-hidden="true" />
|
||||
<IconEye v-else class="size-4" aria-hidden="true" />
|
||||
</Button>
|
||||
</InputGroupSuffix>
|
||||
</InputGroup>
|
||||
</TextField>
|
||||
</template>
|
||||
Reference in New Issue
Block a user