prepare use of vue for game/replay

This commit is contained in:
Zutatensuppe 2021-05-13 16:58:21 +02:00
parent 343263be6c
commit 8e7aa7d453
7 changed files with 156 additions and 43 deletions

View file

@ -2,13 +2,30 @@
<head>
<link rel="stylesheet" href="/style.css" />
<script src="https://unpkg.com/vue@3.0.11"></script>
<script src="https://unpkg.com/vue-router@4.0.8"></script>
<title>🧩 jigsaw.hyottoko.club</title>
</head>
<body>
<div id="app"></div>
<script type="module">
import App from "/App.vue.js"
import Index from "/views/Index.vue.js"
const app = Vue.createApp(Index)
import NewGame from "/views/NewGame.vue.js"
import Game from "/views/Game.vue.js"
import Replay from "/views/Replay.vue.js"
const router = VueRouter.createRouter({
history: VueRouter.createWebHashHistory(),
routes: [
{ name: 'index', path: '/', component: Index },
{ name: 'new-game', path: '/new-game', component: NewGame },
{ name: 'game', path: '/g/:id', component: Game },
{ name: 'replay', path: '/replay/:id', component: Replay },
],
})
const app = Vue.createApp(App)
app.use(router)
app.mount('#app')
</script>
</body>