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.

47 lines
1016 B

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <template>
  2. <div class="hello">
  3. <nav>
  4. <router-link v-for="day in days" :to="'/' + $route.params.mensa + '/' + day" :key="day">{{dayOfWeek[day]}}</router-link>
  5. </nav>
  6. <router-view></router-view>
  7. </div>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'mensa',
  12. data () {
  13. return {
  14. days: [1, 2, 3, 4, 5, 6],
  15. dayOfWeek: {
  16. 1: 'Montag',
  17. 2: 'Dienstag',
  18. 3: 'Mittwoch',
  19. 4: 'Donnerstag',
  20. 5: 'Freitag',
  21. 6: 'Samstag'
  22. }
  23. }
  24. },
  25. watch: {
  26. '$route': function () {
  27. if (!this.$route.fullPath.endsWith('/')) {
  28. this.$router.replace(this.$route.fullPath + '/')
  29. }
  30. if (!this.$route.params.tag) {
  31. this.$router.push('' + new Date().getDay())
  32. }
  33. }
  34. },
  35. mounted () {
  36. if (!this.$route.fullPath.endsWith('/')) {
  37. this.$router.replace(this.$route.fullPath + '/')
  38. }
  39. if (!this.$route.params.tag) {
  40. this.$router.push('' + new Date().getDay())
  41. }
  42. }
  43. }
  44. </script>
  45. <style></style>