Speiseplan der Mensen der Georg-August-Universität Göttingen https://mensa.schneider-hosting.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

64 lines
1.2 KiB

<template>
<div class="hello">
<div class="meal" v-for="meal in meals">
<h3>{{meal.category}}</h3>
<p>{{meal.title}}</p>
</div>
</div>
</template>
<script>
export default {
name: 'mensa',
data () {
return {
meals: [],
days: [1, 2, 3, 4, 5, 6],
dayOfWeek: {
1: 'Montag',
2: 'Dienstag',
3: 'Mittwoch',
4: 'Donnerstag',
5: 'Freitag',
6: 'Samstag'
}
}
},
watch: {
'$route': function () {
if (!this.$route.fullPath.endsWith('/')) {
this.$router.replace(this.$route.fullPath + '/')
}
if (!this.$route.params.tag) {
this.$router.push('' + (new Date().getDay() || 1))
}
this.loadMeals()
}
},
methods: {
loadMeals () {
fetch(`/static/${this.$route.params.mensa}.${this.$route.params.tag}.json`)
.then(res => res.json())
.then(menu => { this.meals = menu.meals })
}
},
created () {
this.$router.replace(`/zentralmensa/${new Date().getDay() || 1}`)
this.loadMeals()
}
}
</script>
<style>
.meal{
margin: 2em 0;
}
.meal>h3{
margin-bottom:0em;
}
.meal>p{
margin-top: 0.4em;
}
</style>