mirror of
https://github.com/Xevion/the-office.git
synced 2025-12-15 16:13:20 -06:00
beginnings of simple Character page (list button links, base page with card)
This commit is contained in:
18
client/src/components/Character.vue
Normal file
18
client/src/components/Character.vue
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<b-card>
|
||||||
|
<h4>{{ this.$route.params.character }}</h4>
|
||||||
|
</b-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.card-body h4 {
|
||||||
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
<b-button squared class="mx-2 my-1 character-button" size="sm"
|
<b-button squared class="mx-2 my-1 character-button" size="sm"
|
||||||
v-for="character in characters" :key="character.name" :id="`character-${character.id}`"
|
v-for="character in characters" :key="character.name" :id="`character-${character.id}`"
|
||||||
:title="`${character.appearances} Quote${character.appearances > 1 ? 's' : ''}`"
|
:title="`${character.appearances} Quote${character.appearances > 1 ? 's' : ''}`"
|
||||||
|
:to="`/character/${character.id}`"
|
||||||
>
|
>
|
||||||
{{ character.name }}
|
{{ character.name }}
|
||||||
<b-badge class="ml-1">{{ character.appearances}}</b-badge>
|
<b-badge class="ml-1">{{ character.appearances}}</b-badge>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import Router from 'vue-router';
|
|||||||
import Home from './components/Home.vue';
|
import Home from './components/Home.vue';
|
||||||
import Episode from './components/Episode.vue';
|
import Episode from './components/Episode.vue';
|
||||||
import SearchResults from './components/SearchResults.vue';
|
import SearchResults from './components/SearchResults.vue';
|
||||||
|
import Character from './components/Character.vue';
|
||||||
|
|
||||||
Vue.use(Router);
|
Vue.use(Router);
|
||||||
|
|
||||||
@@ -15,6 +16,11 @@ export default new Router({
|
|||||||
name: 'Home',
|
name: 'Home',
|
||||||
component: Home,
|
component: Home,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/character/:character',
|
||||||
|
name: 'Character',
|
||||||
|
component: Character,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/:season/:episode',
|
path: '/:season/:episode',
|
||||||
name: 'Episode',
|
name: 'Episode',
|
||||||
@@ -25,6 +31,9 @@ export default new Router({
|
|||||||
name: 'SearchResults',
|
name: 'SearchResults',
|
||||||
component: SearchResults,
|
component: SearchResults,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '*',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
scrollBehavior(to, from, savedPosition) {
|
scrollBehavior(to, from, savedPosition) {
|
||||||
// https://router.vuejs.org/guide/advanced/scroll-behavior.html
|
// https://router.vuejs.org/guide/advanced/scroll-behavior.html
|
||||||
|
|||||||
Reference in New Issue
Block a user