work on loading in character list data
This commit is contained in:
@@ -2,6 +2,7 @@ import { createRouter, createWebHashHistory } from 'vue-router'
|
|||||||
|
|
||||||
import GameList from '../vues/GameList.vue'
|
import GameList from '../vues/GameList.vue'
|
||||||
import GameDetails from '../vues/GameDetails.vue'
|
import GameDetails from '../vues/GameDetails.vue'
|
||||||
|
import CharacterList from '../vues/CharacterList.vue'
|
||||||
|
|
||||||
const root = {
|
const root = {
|
||||||
path: '/',
|
path: '/',
|
||||||
@@ -18,7 +19,12 @@ const gameDetailsRoute = {
|
|||||||
component: GameDetails
|
component: GameDetails
|
||||||
}
|
}
|
||||||
|
|
||||||
const routes = [root, gameListRoute, gameDetailsRoute]
|
const characterListRoute = {
|
||||||
|
path: '/characters',
|
||||||
|
component: CharacterList
|
||||||
|
}
|
||||||
|
|
||||||
|
const routes = [root, gameListRoute, gameDetailsRoute, characterListRoute]
|
||||||
|
|
||||||
export default createRouter({
|
export default createRouter({
|
||||||
history: createWebHashHistory(),
|
history: createWebHashHistory(),
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, onCreated, ref } from 'vue'
|
import { onMounted, onCreated, ref } from 'vue'
|
||||||
import { Game, useGameStore } from '../store/gamestore'
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
let page = 1
|
let page = 1
|
||||||
@@ -46,6 +45,4 @@ async function previousPage() {
|
|||||||
page--
|
page--
|
||||||
games.value = await axios.post('/api/game', { page: `${page}`, count: '10', orderBy: 'id' })
|
games.value = await axios.post('/api/game', { page: `${page}`, count: '10', orderBy: 'id' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// const games = useGameStore()
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user