IntelliClass_FE/components/app/Sidebar.vue
Timothy Yin b05f954923
feat: add authentication requirements to course preparation and resources pages
fix: update home page background image and remove unnecessary redirect code

chore: update pnpm lock file with new dependencies for auto-animate and svg spinners

delete: remove unused images from public directory

refactor: modify course and user types for better clarity and structure

feat: implement course API with CRUD operations and teacher team management

feat: create user authentication page with login functionality and validation

feat: add login state management with Pinia for user session handling

style: create reusable UI components for cards and tabs

chore: implement HTTP utility for API requests with error handling
2025-04-06 00:25:20 +08:00

63 lines
1.5 KiB
Vue

<script lang="ts" setup>
import type { LucideIcon } from "lucide-vue-next";
import type { SidebarProps } from "../ui/sidebar";
import type { RouteLocationRaw } from "vue-router";
export interface SidebarNavItem {
title: string;
url?: string | RouteLocationRaw;
icon: LucideIcon | string;
isActive?: boolean;
items?: {
title: string;
url: string;
}[];
}
export interface SidebarNavGroup {
label?: string;
items: SidebarNavItem[];
}
const props = withDefaults(
defineProps<
SidebarProps & {
nav: SidebarNavGroup[];
}
>(),
{
collapsible: "offcanvas",
variant: "sidebar",
}
);
const loginState = useLoginState();
</script>
<template>
<Sidebar v-bind="props">
<SidebarHeader>
<div
class="flex h-12 justify-center items-center gap-2 rounded truncate group-has-[[data-collapsible=icon]]/sidebar-wrapper:justify-start transition-all duration-200 ease-in-out"
>
<NuxtImg
src="/images/xsh_logo.png"
alt="Logo"
class="w-9 max-w-9 aspect-square group-has-[[data-collapsible=icon]]/sidebar-wrapper:w-full transition-all duration-200 ease-in-out"
/>
<h1 class="text-lg font-medium">智课教学平台</h1>
</div>
</SidebarHeader>
<SidebarContent>
<slot name="extra-header" />
<AppNavMain :nav="nav" />
</SidebarContent>
<SidebarFooter>
<AppNavUser :user="loginState.user" />
</SidebarFooter>
<SidebarRail />
</Sidebar>
</template>
<style scoped></style>