add Quizz route

This commit is contained in:
2020-05-03 11:34:35 +02:00
parent ee3eca7d8f
commit 9b56cf0f27
5 changed files with 46 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ import ToDoListIndex from './views/ToDoLists/ToDoListIndex'
import ToDoListShow from './views/ToDoLists/ToDoListShow'
import GameIndex from './views/Games/GameIndex'
import Hangman from './views/Games/HangMan/Hangman'
import Quizz from './views/Games/Quizz/Quizz'
Vue.use(VueRouter)
@@ -72,5 +73,9 @@ export default new VueRouter({
path: '/jeux/pendu', component: Hangman,
meta: {title: 'Jeu : Le pendu'}
},
{
path: '/jeux/quizz', component: Quizz,
meta: {title: 'Jeu : Quizz'}
},
]
})

View File

@@ -1,19 +1,21 @@
<template>
<div class="p-4">
<h1 class="page-title">Liste des jeux</h1>
<div class="flex flex-wrap mt-4">
<HangmanIndex link="/jeux/pendu" class="w-full sm:w-1/2 md:w-1/3 lg:w-1/4 card" />
<div class="flex flex-wrap -m-2 mt-2">
<HangmanIndex link="/jeux/pendu" class="w-full sm:w-1/2 md:w-1/3 lg:w-1/4" />
<QuizzIndex link="/jeux/quizz" class="w-full sm:w-1/2 md:w-1/3 lg:w-1/4" />
</div>
</div>
</template>
<script>
import HangmanIndex from './HangMan/HangmanIndex'
import QuizzIndex from './Quizz/QuizzIndex'
export default {
name: 'GameIndex',
components: {
HangmanIndex
HangmanIndex, QuizzIndex
}
}
</script>

View File

@@ -1,7 +1,9 @@
<template>
<router-link :to="link">
<svg-vue icon="hangman" />
<h2>Pendu</h2>
<div class="m-2 card">
<svg-vue icon="hangman" />
<h2>Pendu</h2>
</div>
</router-link>
</template>

View File

@@ -0,0 +1,11 @@
<template>
<div>
<h1>Quizz</h1>
</div>
</template>
<script>
export default {
name: 'Quizz'
}
</script>

View File

@@ -0,0 +1,21 @@
<template>
<router-link :to="link">
<div class="m-2 card">
<svg-vue icon="close" />
<h2>Quizz</h2>
</div>
</router-link>
</template>
<script>
export default {
name: 'QuizzIndex',
props: {
link: {
type: String,
required: true
},
}
}
</script>