feat: initialize Vue component library and aligned documentation
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
Card,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
CardDescription,
|
||||
CardContent,
|
||||
CardFooter,
|
||||
Button,
|
||||
} from "@heroui-vue/components";
|
||||
import { Input, Label } from "@heroui-vue/components";
|
||||
import { ref, useId } from "vue";
|
||||
const id = useId();
|
||||
const submitted = ref(false);
|
||||
const message = ref("");
|
||||
</script>
|
||||
<template>
|
||||
<Card class="w-full max-w-md">
|
||||
<CardHeader>
|
||||
<CardTitle>登录</CardTitle>
|
||||
<CardDescription>输入账号信息以访问您的账户</CardDescription>
|
||||
</CardHeader>
|
||||
<form class="flex flex-col" @submit.prevent="submitted = true">
|
||||
<CardContent>
|
||||
<div class="flex flex-col gap-4">
|
||||
<div class="flex flex-col gap-1">
|
||||
<Label :for="id + '-email'">邮箱</Label>
|
||||
<Input
|
||||
:id="id + '-email'"
|
||||
name="email"
|
||||
type="email"
|
||||
autocomplete="email"
|
||||
placeholder="email@example.com"
|
||||
variant="secondary"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-col gap-1">
|
||||
<Label :for="id + '-password'">密码</Label>
|
||||
<Input
|
||||
:id="id + '-password'"
|
||||
name="password"
|
||||
type="password"
|
||||
autocomplete="current-password"
|
||||
placeholder="••••••••"
|
||||
variant="secondary"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
<CardFooter class="mt-4 flex flex-col gap-2">
|
||||
<Button class="w-full" type="submit">登录</Button>
|
||||
<a
|
||||
class="demo-link text-center text-sm"
|
||||
href="#"
|
||||
@click.prevent="message = '请联系账户管理员重置密码。'"
|
||||
>
|
||||
忘记密码?
|
||||
</a>
|
||||
</CardFooter>
|
||||
<p
|
||||
v-if="submitted || message"
|
||||
role="status"
|
||||
class="mt-2 text-sm text-muted"
|
||||
>
|
||||
{{ message || "表单提交成功!此示例不会发送账号信息。" }}
|
||||
</p>
|
||||
</form>
|
||||
</Card>
|
||||
</template>
|
||||
Reference in New Issue
Block a user