refactor. 페이지 데이터 처리 및 레이아웃 관련 코드 개선

- 페이지 데이터 초기화 및 설정 로직 개선
- 불필요한 props 제거 및 상태 관리 개선

Made-with: Cursor
This commit is contained in:
clkim
2026-03-18 16:30:43 +09:00
parent 0297b3d690
commit f718b01b03
9 changed files with 94 additions and 68 deletions

View File

@@ -8,8 +8,8 @@ const currentPageData = ref<PageDataValue | null>(null)
onMounted(() => {
const pageDataStore = usePageDataStore()
const { pageData, pageLayoutType } = storeToRefs(pageDataStore)
currentPageData.value = pageData.value
currentLayout.value = pageLayoutType.value
currentPageData.value = pageData.value
})
definePageMeta({
@@ -20,6 +20,6 @@ definePageMeta({
<template>
<NuxtLayout :name="currentLayout">
<LayoutsMain v-if="currentPageData" :page-data="currentPageData" />
<LayoutsMain v-if="currentPageData" />
</NuxtLayout>
</template>

View File

@@ -20,6 +20,6 @@ definePageMeta({
<template>
<NuxtLayout :name="currentLayout">
<LayoutsMain v-if="currentPageData" :page-data="currentPageData" />
<LayoutsMain v-if="currentPageData" />
</NuxtLayout>
</template>

View File

@@ -8,8 +8,8 @@ const currentPageData = ref<PageDataValue | null>(null)
onMounted(() => {
const pageDataStore = usePageDataStore()
const { pageData, pageLayoutType } = storeToRefs(pageDataStore)
currentPageData.value = pageData.value
currentLayout.value = pageLayoutType.value
currentPageData.value = pageData.value
})
definePageMeta({
@@ -20,6 +20,6 @@ definePageMeta({
<template>
<NuxtLayout :name="currentLayout">
<LayoutsMain v-if="currentPageData" :page-data="currentPageData" />
<LayoutsMain v-if="currentPageData" />
</NuxtLayout>
</template>