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,
|
tableData: undefined,
|
||||||
}),
|
}),
|
||||||
mounted() {
|
mounted() {
|
||||||
const vm = this
|
this.loadStations()
|
||||||
this.$jquery.getJSON('https://de1.api.radio-browser.info/json/stations/topclick?limit=20')
|
},
|
||||||
.done(function(data) {
|
methods: {
|
||||||
vm.tableData = data
|
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>
|
</script>
|
||||||
|
@ -10,14 +10,14 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody v-if="stationData">
|
<tbody v-if="stationData">
|
||||||
<tr v-for="(obj, ind) in stationData" :key="ind">
|
<tr v-for="station in stationData" :key="station">
|
||||||
<td>
|
<td>
|
||||||
<div class="stationIcon"
|
<div class="stationIcon"
|
||||||
:style="{ backgroundImage: `url('${ obj.favicon }')` }" />
|
:style="{ backgroundImage: `url('${ station.favicon }')` }" />
|
||||||
</td>
|
</td>
|
||||||
<td class="filenameColumn">
|
<td class="filenameColumn">
|
||||||
<span class="innernametext">
|
<span class="innernametext">
|
||||||
{{ obj.name }}
|
{{ station.name }}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="actionColumn">
|
<td class="actionColumn">
|
||||||
|
Loading…
Reference in New Issue
Block a user