further work jquery query api

This commit is contained in:
Jonas Heinrich 2020-10-16 12:37:31 +02:00
parent 1539608790
commit faa9dc67c0
2 changed files with 11 additions and 11 deletions

View File

@ -17,12 +17,10 @@
<Breadcrumb title="Top" href="/Top" /> <Breadcrumb title="Top" href="/Top" />
</Breadcrumbs> </Breadcrumbs>
<Table <Table
:data="tableData" :stationData="tableData"
station-name="SRF Virus"
station-uuid="960b6cd6-0601-11e8-ae97-52543be04c81" station-uuid="960b6cd6-0601-11e8-ae97-52543be04c81"
station-isfav="false" station-isfav="false"
station-img="https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/Radio_SRF_Virus.svg/205px-Radio_SRF_Virus.svg.png" /> station-img="https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/Radio_SRF_Virus.svg/205px-Radio_SRF_Virus.svg.png" />
{{ tableData }}
</AppContent> </AppContent>
</Content> </Content>
</template> </template>
@ -51,9 +49,10 @@ export default {
tableData: undefined, tableData: undefined,
}), }),
mounted() { mounted() {
this.$jquery.get('https://de1.api.radio-browser.info/json/stations/topclick?limit=10') const vm = this
.function((data) => { this.$jquery.getJSON('https://de1.api.radio-browser.info/json/stations/topclick?limit=10')
this.tableData = data .done(function(data) {
vm.tableData = data
}) })
}, },
} }

View File

@ -9,14 +9,14 @@
<th /> <th />
</tr> </tr>
</thead> </thead>
<tbody> <tbody v-if="stationData">
<tr v-if="tableData"> <tr v-for="(obj, ind) in stationData" :key="ind">
<td> <td>
<div class="stationIcon" :style="style" /> <div class="stationIcon" :style="style" />
</td> </td>
<td class="filenameColumn"> <td class="filenameColumn">
<span class="innernametext"> <span class="innernametext">
{{ stationName }} {{ obj.name }}
</span> </span>
</td> </td>
<td class="actionColumn"> <td class="actionColumn">
@ -31,6 +31,7 @@
</td> </td>
</tr> </tr>
</tbody> </tbody>
{{ stationData }}
</table> </table>
</template> </template>
@ -45,9 +46,9 @@ export default {
ActionButton, ActionButton,
}, },
props: { props: {
stationName: { stationData: {
type: String, type: String,
required: true, default: '',
}, },
stationIsfav: { stationIsfav: {
type: Boolean, type: Boolean,