diff --git a/src/components/Tag.vue b/src/components/Tag.vue index f14832b..b67e086 100644 --- a/src/components/Tag.vue +++ b/src/components/Tag.vue @@ -1,8 +1,11 @@ @@ -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 }) + } } }