- Added detail pages for both spells and schools

This commit is contained in:
Alexis
2020-12-24 22:54:18 +01:00
parent d69ea0fa72
commit 7b932f1b86
7 changed files with 98 additions and 68 deletions

View File

@@ -1,14 +1,38 @@
<template>
<div class="container-fluid p-4" id="spell-container">
<h1 class="display-3 font-display mb-3">Sortilège I</h1>
</div>
<h1 class="display-3 font-display mb-3">{{ spell.name }}</h1>
<p>{{ spell.description }}</p> </div>
</template>
<script>
// API
import { RepositoryFactory } from "~/api/repositories";
const Spells = RepositoryFactory.get('spells');
export default {
name: 'single-spell-page',
metaInfo: {
titleTemplate: '%s - Sortilège I'
metaInfo() {
return {
titleTemplate: `%s - ${this.spell.name}`,
}
},
data() {
return {
id: this.$route.params.id,
spell: {},
errors: {
loading: "",
}
}
},
created() {
Spells.getOne(this.id)
.then(v => {
this.spell = v.data;
})
.catch(err => {
console.log(err);
});
},
}
</script>