- Added title and meta info to current views
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="container-fluid p-4" id="spell-container">
|
||||
<h1 class="display-3 font-display mb-3">{{ school.name }}</h1>
|
||||
<p>{{ school.description }}</p>
|
||||
<spell-list :school_id="id"/>
|
||||
</div>
|
||||
<div class="container-fluid p-4" id="spell-container">
|
||||
<h1 class="display-3 font-display mb-3">{{ school.name }}</h1>
|
||||
<p>{{ school.description }}</p>
|
||||
<spell-list :school_id="id"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -14,32 +14,35 @@ import { RepositoryFactory } from "~/api/repositories"
|
||||
const Schools = RepositoryFactory.get('schools')
|
||||
|
||||
export default {
|
||||
name: 'single-school-page',
|
||||
components: {
|
||||
'spell-list': SpellsList,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
school: {},
|
||||
id: this.$route.params.id
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.computeSchool()
|
||||
},
|
||||
methods: {
|
||||
async fetchSchool(id) {
|
||||
const { data } = await Schools.getOne(id)
|
||||
return data
|
||||
},
|
||||
async computeSchool() {
|
||||
this.loading = true
|
||||
const displaySchool = await this.fetchSchool(this.id)
|
||||
this.loading = false
|
||||
this.school = displaySchool
|
||||
},
|
||||
name: 'single-school-page',
|
||||
metaInfo: {
|
||||
titleTemplate: '%s - Maîtrise I'
|
||||
},
|
||||
components: {
|
||||
'spell-list': SpellsList,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
school: {},
|
||||
id: this.$route.params.id
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.computeSchool();
|
||||
},
|
||||
methods: {
|
||||
async fetchSchool(id) {
|
||||
const { data } = await Schools.getOne(id);
|
||||
return data;
|
||||
},
|
||||
async computeSchool() {
|
||||
this.loading = true;
|
||||
const displaySchool = await this.fetchSchool(this.id);
|
||||
this.loading = false;
|
||||
this.school = displaySchool;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user