Files
front/pages/game/[id].vue
T
2024-12-30 00:02:09 +01:00

19 lines
372 B
Vue

<script setup lang="ts">
import { useGameStore } from "~/store/game.store";
const route = useRoute();
const gameId = Number(route.params.id);
const gameStore = useGameStore();
const game = await gameStore.fetchGame(gameId);
onBeforeMount(() => {
gameStore.subscribe(gameId);
});
onUnmounted(() => {
gameStore.close();
});
</script>
<template>{{ game }}</template>