- Create IndexContent component to avoid code duplication - Score icon links to /work/[slug] with clean URLs - Modal opens automatically via slug prop (works with SSR) - Crawler finds and prerenders all /work/ pages (145 routes) - Work page redirects to / when modal closes - Single source of truth for data fetching in IndexContent
21 lines
394 B
Vue
21 lines
394 B
Vue
<template>
|
|
<IndexContent :slug="slug" />
|
|
</template>
|
|
|
|
<script setup>
|
|
import { useModalStore } from "@/stores/ModalStore"
|
|
import { watch } from "vue"
|
|
|
|
const route = useRoute()
|
|
const modalStore = useModalStore()
|
|
const router = useRouter()
|
|
|
|
const slug = route.params.slug
|
|
|
|
watch(() => modalStore.isOpen, (isOpen) => {
|
|
if (!isOpen) {
|
|
router.push('/')
|
|
}
|
|
})
|
|
</script>
|