完成布局
This commit is contained in:
@@ -48,20 +48,20 @@
|
||||
<div>
|
||||
<NuxtLink
|
||||
to="/"
|
||||
class="flex items-center px-4 py-3 text-sm font-medium rounded-xl text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 hover:shadow-sm transition-all duration-200"
|
||||
class="flex items-center px-4 py-2 text-sm font-medium rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 hover:shadow-sm transition-all duration-200"
|
||||
:class="{
|
||||
'bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 shadow-sm':
|
||||
$route.path === '/',
|
||||
}"
|
||||
>
|
||||
<Icon name="uim:house-user" class="text-primary mr-2" size="20" />
|
||||
<Icon name="lucide-home" class="text-primary mr-2" size="20" />
|
||||
站点首页
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 分隔线 -->
|
||||
<div class="flex items-center px-6 p-1 ">
|
||||
<div class="flex items-center px-8 p-1 ">
|
||||
<ContentDirectory />
|
||||
</div>
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
<UContentNavigation
|
||||
:navigation="directoryNavigation"
|
||||
highlight
|
||||
|
||||
color="primary"
|
||||
variant="pill"
|
||||
/>
|
||||
|
42
app/components/auth/login.vue
Normal file
42
app/components/auth/login.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<script setup lang="ts">
|
||||
const providers = ref([
|
||||
{
|
||||
label: 'Google',
|
||||
icon: 'i-simple-icons-google',
|
||||
color: 'neutral',
|
||||
variant: 'subtle'
|
||||
},
|
||||
{
|
||||
label: 'GitHub',
|
||||
icon: 'i-simple-icons-github',
|
||||
color: 'neutral',
|
||||
variant: 'subtle'
|
||||
}
|
||||
])
|
||||
const fields = ref([
|
||||
{
|
||||
name: 'email',
|
||||
type: 'text',
|
||||
label: 'Email'
|
||||
},
|
||||
{
|
||||
name: 'password',
|
||||
type: 'password',
|
||||
label: 'Password'
|
||||
}
|
||||
])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UAuthForm
|
||||
class="max-w-md"
|
||||
title="Login"
|
||||
description="Enter your credentials to access your account."
|
||||
icon="i-lucide-user"
|
||||
:fields="fields"
|
||||
:providers="providers"
|
||||
:separator="{
|
||||
icon: 'i-lucide-user'
|
||||
}"
|
||||
/>
|
||||
</template>
|
117
app/components/auth/register.vue
Normal file
117
app/components/auth/register.vue
Normal file
@@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<div class="min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 py-12 px-4 sm:px-6 lg:px-8">
|
||||
<div class="max-w-md w-full space-y-8">
|
||||
<div>
|
||||
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white">
|
||||
创建新账户
|
||||
</h2>
|
||||
<p class="mt-2 text-center text-sm text-gray-600 dark:text-gray-300">
|
||||
或
|
||||
<NuxtLink to="/login" class="font-medium text-blue-600 hover:text-blue-500">
|
||||
登录现有账户
|
||||
</NuxtLink>
|
||||
</p>
|
||||
</div>
|
||||
<form class="mt-8 space-y-6" @submit.prevent="handleRegister">
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label for="username" class="block text-sm font-medium text-gray-700 dark:text-gray-300">用户名</label>
|
||||
<input
|
||||
id="username"
|
||||
v-model="username"
|
||||
type="text"
|
||||
required
|
||||
class="mt-1 appearance-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-md focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
|
||||
placeholder="用户名"
|
||||
>
|
||||
</div>
|
||||
<div>
|
||||
<label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">邮箱地址</label>
|
||||
<input
|
||||
id="email"
|
||||
v-model="email"
|
||||
type="email"
|
||||
required
|
||||
class="mt-1 appearance-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-md focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
|
||||
placeholder="邮箱地址"
|
||||
>
|
||||
</div>
|
||||
<div>
|
||||
<label for="password" class="block text-sm font-medium text-gray-700 dark:text-gray-300">密码</label>
|
||||
<input
|
||||
id="password"
|
||||
v-model="password"
|
||||
type="password"
|
||||
required
|
||||
class="mt-1 appearance-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-md focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
|
||||
placeholder="密码"
|
||||
>
|
||||
</div>
|
||||
<div>
|
||||
<label for="confirm-password" class="block text-sm font-medium text-gray-700 dark:text-gray-300">确认密码</label>
|
||||
<input
|
||||
id="confirm-password"
|
||||
v-model="confirmPassword"
|
||||
type="password"
|
||||
required
|
||||
class="mt-1 appearance-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-md focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"
|
||||
placeholder="确认密码"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center">
|
||||
<input
|
||||
id="agree-terms"
|
||||
v-model="agreeTerms"
|
||||
type="checkbox"
|
||||
required
|
||||
class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"
|
||||
>
|
||||
<label for="agree-terms" class="ml-2 block text-sm text-gray-900 dark:text-gray-300">
|
||||
我同意
|
||||
<a href="#" class="font-medium text-blue-600 hover:text-blue-500">服务条款</a>
|
||||
和
|
||||
<a href="#" class="font-medium text-blue-600 hover:text-blue-500">隐私政策</a>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button
|
||||
type="submit"
|
||||
class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
||||
>
|
||||
创建账户
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const username = ref('')
|
||||
const email = ref('')
|
||||
const password = ref('')
|
||||
const confirmPassword = ref('')
|
||||
const agreeTerms = ref(false)
|
||||
|
||||
const handleRegister = () => {
|
||||
// TODO: Implement actual registration logic
|
||||
console.log('Registration attempt:', {
|
||||
username: username.value,
|
||||
email: email.value,
|
||||
password: password.value,
|
||||
confirmPassword: confirmPassword.value,
|
||||
agreeTerms: agreeTerms.value
|
||||
})
|
||||
|
||||
// For demo purposes, redirect to home
|
||||
navigateTo('/')
|
||||
}
|
||||
|
||||
useSeoMeta({
|
||||
title: '注册 - Easy Docs',
|
||||
description: '创建您的 Easy Docs 账户'
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user