diff --git a/src/components/Main.vue b/src/components/Main.vue index 3a7900e..69edf89 100644 --- a/src/components/Main.vue +++ b/src/components/Main.vue @@ -49,24 +49,25 @@ export default { $route: 'onRoute', }, mounted() { - this.loadStations() this.scroll() }, methods: { async onRoute() { + this.offset = 0 + this.tableData = [] const route = this.$route switch (route.name) { - case this.routes.TOP: - console.log('new route: TOP') + case 'TOP': + this.loadStations() break - case this.routes.RECENT: - console.log('new route: RECENT') + case 'RECENT': + this.loadStations() break - case this.routes.FAVORITES: - console.log('new route: FAVORITES') + case 'FAVORITES': + this.loadStations() break - case this.routes.CATEGORIES: - console.log('new route: CATEGORIES') + case 'CATEGORIES': + this.loadStations() break } }, @@ -114,8 +115,9 @@ export default { * Fetching radio stations using Radio-Browser.info API */ loadStations() { + // https://de1.api.radio-browser.info/json/stations/lastchange?limit=10 const vm = this - this.$jquery.getJSON('https://de1.api.radio-browser.info/json/stations/search', + this.$jquery.getJSON('https://de1.api.radio-browser.info/json/stations', { limit: 20, order: 'clickcount',