home.vue 769 B

12345678910111213141516171819202122232425262728293031
  1. <script setup>
  2. import radiomanifest from "@radiomanifest/radiomanifest";
  3. import { useRadioStore } from "../js/store";
  4. const store = useRadioStore();
  5. setTimeout(() => {
  6. let i = 0;
  7. for (const url of Object.keys(store.radios)) {
  8. i++;
  9. store.startFetchingRadio(url);
  10. setTimeout(() => {
  11. radiomanifest.get(url).then((data) => {
  12. store.updateRadio(url, data);
  13. });
  14. }, i * 2000);
  15. }
  16. }, 100);
  17. </script>
  18. <template>
  19. <f7-page name="home">
  20. <!-- Page content-->
  21. <f7-block-title>Radio</f7-block-title>
  22. <f7-list>
  23. <f7-list-item
  24. v-for="(radio, url) in store.radios"
  25. :key="radio.name"
  26. :link="`/radio/${encodeURIComponent(url)}`"
  27. :title="radio.name"
  28. />
  29. </f7-list>
  30. </f7-page>
  31. </template>