请求检索数据后如何V-Cards动态填充?Axios
axios请求正确完成,但从未v-for填充v-cards. 我也尝试过在渲染完成之前发出请求(在创建生命周期事件之前),这也失败了。
编辑:数据检索成功完成,这让我认为 v-for 的工作方式存在问题?也许我错过了什么? https://imgur.com/a/uOqZ2wN(响应数据)
<template>
<v-container class="pa-2" fluid>
<v-layout v-for="(clip) in clipData" :key="clip.id">
<v-card>
<v-img
:src="clip.thumbnail_url"
class="white--text"
height="200px"
>
<v-card-title class="fill-height align-end" v-text="clip.title"></v-card-title>
</v-img>
</v-card>
</v-layout>
</v-container>
</template>
<script lang="ts">
// Imports omitted for brevity
@Component({
components: {}
})
export default class Clips extends Vue {
public clipData: any;
mounted() {
// Axios Request Data From twitch helix API regarding Clip Information on My channel
helix.get('clips?broadcaster_id=<myidOmitted>&first=10').then((data) => {
this.clipData = data.data.data; // <-- Third data is the array of clips i need.
}).catch((err) => {
console.log(err)
})
}
}
</script>