|
|
@ -1,8 +1,11 @@ |
|
|
|
<template> |
|
|
|
<div class="hello"> |
|
|
|
<p> |
|
|
|
{{ $route.fullPath }} |
|
|
|
</p> |
|
|
|
<table> |
|
|
|
<tr v-for="meal in meals"> |
|
|
|
<td>{{meal.category}}</td> |
|
|
|
<td>{{meal.title}}</td> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
@ -14,10 +17,16 @@ export default { |
|
|
|
meals: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: {$route: 'loadMeals'}, |
|
|
|
created () { |
|
|
|
fetch(`/static/${this.$route.params.mensa}.${this.$route.params.tag}.json`) |
|
|
|
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}) |
|
|
|
.then(menu => { this.meals = menu.meals }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|