Browse Source

Show date of menus

vuex
Schneider 8 years ago
parent
commit
d8f54405ea
  1. 15
      src/components/Mensa.vue

15
src/components/Mensa.vue

@ -1,5 +1,6 @@
<template> <template>
<div class="hello">
<div class="mensa">
<h3 id="date">{{date}}</h3>
<div class="meal" v-for="meal in meals"> <div class="meal" v-for="meal in meals">
<h3>{{meal.category}}</h3> <h3>{{meal.category}}</h3>
<p>{{meal.title}}</p> <p>{{meal.title}}</p>
@ -13,6 +14,7 @@ export default {
data () { data () {
return { return {
meals: [], meals: [],
date: '',
days: [1, 2, 3, 4, 5, 6], days: [1, 2, 3, 4, 5, 6],
dayOfWeek: { dayOfWeek: {
1: 'Montag', 1: 'Montag',
@ -39,7 +41,10 @@ export default {
loadMeals () { loadMeals () {
fetch(`/static/${this.$route.params.mensa}.${this.$route.params.tag}.json`) fetch(`/static/${this.$route.params.mensa}.${this.$route.params.tag}.json`)
.then(res => res.json()) .then(res => res.json())
.then(menu => { this.meals = menu.meals })
.then(menu => {
this.meals = menu.meals
this.date = menu.date
})
} }
}, },
created () { created () {
@ -61,4 +66,10 @@ export default {
margin-top: 0.4em; margin-top: 0.4em;
} }
#date{
margin-bottom: -1em;
}
.mensa{
margin-bottom: 3em;
}
</style> </style>
Loading…
Cancel
Save