seperate method for loading stations
This commit is contained in:
parent
316b04368c
commit
610953fc1b
15
src/App.vue
15
src/App.vue
@ -49,11 +49,16 @@ export default {
|
||||
tableData: undefined,
|
||||
}),
|
||||
mounted() {
|
||||
const vm = this
|
||||
this.$jquery.getJSON('https://de1.api.radio-browser.info/json/stations/topclick?limit=20')
|
||||
.done(function(data) {
|
||||
vm.tableData = data
|
||||
})
|
||||
this.loadStations()
|
||||
},
|
||||
methods: {
|
||||
loadStations() {
|
||||
const vm = this
|
||||
this.$jquery.getJSON('https://de1.api.radio-browser.info/json/stations/topclick?limit=20')
|
||||
.done(function(data) {
|
||||
vm.tableData = data
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -10,14 +10,14 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody v-if="stationData">
|
||||
<tr v-for="(obj, ind) in stationData" :key="ind">
|
||||
<tr v-for="station in stationData" :key="station">
|
||||
<td>
|
||||
<div class="stationIcon"
|
||||
:style="{ backgroundImage: `url('${ obj.favicon }')` }" />
|
||||
:style="{ backgroundImage: `url('${ station.favicon }')` }" />
|
||||
</td>
|
||||
<td class="filenameColumn">
|
||||
<span class="innernametext">
|
||||
{{ obj.name }}
|
||||
{{ station.name }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="actionColumn">
|
||||
|
Loading…
Reference in New Issue
Block a user