[UI 개선] 서브메뉴 및 탭 바 컴포넌트 추가, AppHeader 및 기본 레이아웃 수정, API 호출 로직 개선

This commit is contained in:
2025-09-24 16:25:30 +09:00
parent f83782813d
commit f9dde4eb09
10 changed files with 338 additions and 490 deletions

View File

@@ -1,6 +1,6 @@
import { defineStore } from "pinia";
interface Tab {
export interface Tab {
key: number; // 1~10
label: string;
to: string; // 페이지 라우트
@@ -46,7 +46,7 @@ export const useTabsStore = defineStore("tabs", {
$router.push(`/${tab?.key}${tab?.to}`);
},
// 활 탭 제거
// 활 탭 제거
removeTab(key: number) {
this.tabs = this.tabs.filter(t => t.key !== key);
if (this.activeTab === key) {
@@ -58,6 +58,7 @@ export const useTabsStore = defineStore("tabs", {
// 활성 탭 변경
setActiveTab(key: number) {
console.log("tab.ts - setActiveTab", key);
const { $router } = useNuxtApp();
this.activeTab = key;
@@ -67,11 +68,12 @@ export const useTabsStore = defineStore("tabs", {
// 탭 초기화
resetTabs() {
const { $router } = useNuxtApp();
this.tabs = [defaultTab];
console.log("tab.ts - resetTabs");
this.tabs = [{ ...defaultTab }];
this.activeTab = 1;
$router.push(defaultTab.to);
console.log("tab.ts - tabs:", this.tabs);
console.log("tab.ts - activeTab:", this.activeTab);
console.log("tab.ts - resetTabs 완료");
},
},
persist: true,