feat. i18n 설정
This commit is contained in:
@@ -3,10 +3,8 @@ import { defineStore } from "pinia";
|
||||
export const useLoadingStore = defineStore("loadingStore", () => {
|
||||
// 글로벌 로딩 표기
|
||||
const fullLoading = ref(false);
|
||||
// 컴포넌트별 로딩 표기
|
||||
const localLoadings = ref<
|
||||
Map<string, { active: boolean; element?: HTMLElement }>
|
||||
>(new Map());
|
||||
// 컴포넌트별 로딩 표기 - Map 대신 일반 객체 사용
|
||||
const localLoadings = ref<Record<string, { active: boolean }>>({});
|
||||
// 로딩 상태만 표기
|
||||
const isLoading = ref(false);
|
||||
|
||||
@@ -15,7 +13,7 @@ export const useLoadingStore = defineStore("loadingStore", () => {
|
||||
*/
|
||||
const initializeStore = () => {
|
||||
fullLoading.value = false;
|
||||
localLoadings.value.clear();
|
||||
localLoadings.value = {};
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -33,15 +31,15 @@ export const useLoadingStore = defineStore("loadingStore", () => {
|
||||
* Local 로딩
|
||||
*/
|
||||
const startLocalLoading = (localId: string) => {
|
||||
localLoadings.value.set(localId, { active: true });
|
||||
localLoadings.value[localId] = { active: true };
|
||||
};
|
||||
|
||||
const stopLocalLoading = (localId: string) => {
|
||||
localLoadings.value.delete(localId);
|
||||
delete localLoadings.value[localId];
|
||||
};
|
||||
|
||||
const isLocalLoading = (localId: string) => {
|
||||
return localLoadings.value.get(localId)?.active || false;
|
||||
return localLoadings.value[localId]?.active || false;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user