Radio.vue 1.0 KB

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