refactor. 페이지 데이터 처리 및 레이아웃 관련 코드 개선
- 페이지 데이터 초기화 및 설정 로직 개선 - 불필요한 props 제거 및 상태 관리 개선 Made-with: Cursor
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -20,6 +20,6 @@ definePageMeta({
|
||||
|
||||
<template>
|
||||
<NuxtLayout :name="currentLayout">
|
||||
<LayoutsMain v-if="currentPageData" :page-data="currentPageData" />
|
||||
<LayoutsMain v-if="currentPageData" />
|
||||
</NuxtLayout>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user