26 lines
717 B
Vue
26 lines
717 B
Vue
<script setup lang="ts">
|
|
import { usePageDataStore } from '#layers/stores/usePageDataStore'
|
|
import type { PageDataValue } from '#layers/types/api/pageData'
|
|
|
|
const pageDataStore = usePageDataStore()
|
|
const { pageData } = storeToRefs(pageDataStore)
|
|
|
|
const getLayoutType = (
|
|
pageData: PageDataValue | null
|
|
): 'default' | 'promotion' => {
|
|
return pageData?.page_type === 1 ? 'default' : 'promotion'
|
|
}
|
|
|
|
const currentLayout = computed(() => getLayoutType(pageData.value))
|
|
|
|
definePageMeta({
|
|
layout: false, // 동적 레이아웃을 위해 기본 레이아웃 비활성화
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<NuxtLayout :name="currentLayout">
|
|
<LayoutsMain v-if="pageData" :page-data="pageData" />
|
|
</NuxtLayout>
|
|
</template>
|