Files
web-temp/app/pages/[d1]/index.vue
clkim f718b01b03 refactor. 페이지 데이터 처리 및 레이아웃 관련 코드 개선
- 페이지 데이터 초기화 및 설정 로직 개선
- 불필요한 props 제거 및 상태 관리 개선

Made-with: Cursor
2026-03-18 16:34:11 +09:00

26 lines
763 B
Vue

<script setup lang="ts">
import { usePageDataStore } from '#layers/stores/usePageDataStore'
import type { PageDataValue } from '#layers/types/api/pageData'
const currentLayout = ref<'default' | 'promotion' | null>('default')
const currentPageData = ref<PageDataValue | null>(null)
onMounted(() => {
const pageDataStore = usePageDataStore()
const { pageData, pageLayoutType } = storeToRefs(pageDataStore)
currentLayout.value = pageLayoutType.value
currentPageData.value = pageData.value
})
definePageMeta({
layout: false, // 동적 레이아웃을 위해 기본 레이아웃 비활성화
middleware: ['inspection'],
})
</script>
<template>
<NuxtLayout :name="currentLayout">
<LayoutsMain v-if="currentPageData" />
</NuxtLayout>
</template>