[탭 및 권한 시스템 개선] TabBar에서 이미 활성화된 탭 클릭 시 동작 방지 로직 추가, 권한 리소스 코드로 검색 기능 추가, 권한 테스트 페이지에서 불필요한 로딩 메시지 제거, 탭 관리 스토어에서 중복 탭 체크 및 활성 탭 전환 로직 개선

This commit is contained in:
2025-09-24 17:21:19 +09:00
parent 41523a57b3
commit c0a54bb64c
4 changed files with 28 additions and 6 deletions

View File

@@ -15,12 +15,24 @@ export const useTabsStore = defineStore("tabs", {
activeTab: 1,
}),
actions: {
// 서브메뉴 클릭 시 새 탭 생성
// 서브메뉴 클릭 시 새 탭 생성 (중복 체크 추가)
async updateActiveTab(sub: {
label: string;
to: string;
componentName: string;
}) {
// 이미 동일한 페이지가 열려있는지 확인
const existingTab = this.tabs.find(
tab => tab.to === sub.to && tab.componentName === sub.componentName
);
if (existingTab) {
// 이미 동일한 페이지가 열려있으면 해당 탭으로 이동
this.activeTab = existingTab.key;
await navigateTo(`/${existingTab.key}${existingTab.to}`);
return;
}
if (this.tabs.length > 10) {
alert("탭은 최대 10개까지 열 수 있습니다.");
return;