RadioShows.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <f7-page name="RadioShows">
  3. <img :src='Radio.logo' id='logo'/>
  4. <f7-block-title>{{Radio.name}}</f7-block-title>
  5. <f7-block-header>{{Radio.description}}</f7-block-header>
  6. <div v-if='loading' strong class="text-align-center">
  7. <f7-preloader />
  8. </div>
  9. <f7-list v-else>
  10. <f7-list-item v-for='show in Radio.shows' :key='show.name' :title='show.name'
  11. :link='`/radio/${radioId}/shows/${show.name}`' :footer='show.description'/>
  12. </f7-list>
  13. </f7-page>
  14. </template>
  15. <script>
  16. import radiomanifest from '../js/radiomanifest'
  17. export default {
  18. name: 'radio',
  19. data () {
  20. return {
  21. loading: true,
  22. radioId: null,
  23. radio: { name: '' },
  24. Radio: { }
  25. }
  26. },
  27. props: { f7route: Object, f7router: Object },
  28. async mounted () {
  29. this.radioId = this.f7route.params.radioName
  30. try {
  31. this.Radio = await radiomanifest.get(this.f7route.params.radioName)
  32. this.loading = false
  33. } catch (e) {
  34. console.error('le cose non vanno mai sempre bene!', e)
  35. }
  36. }
  37. }
  38. </script>
  39. <style>
  40. #logo {
  41. margin-left: 10px;
  42. max-width: 40px;
  43. }
  44. </style>