<template>
  <KeepAlive>
    <component
      :is="component.componentInstance"
      v-for="component in componentsList"
      :key="component.name"
      :component="component.component"
    />
  </KeepAlive>
</template>

<script setup>
const menuStore = useMenuStore()

const route = useRoute()

route.params.id = menuStore.defaultMenu.id
route.params.slug = menuStore.defaultMenu.link_rewrite

const store = useStore()
await store.getSections(route.params.id)

onMounted(() => {
  menuStore.openMenu = false
})

useHead(menuStore.headMeta)
const componentsList = await store.getComponents(route.params.id)
</script>
