<template>
<div class="news-list">
<n-card title="">
<n-image-group>
<n-space>
<n-image width="90" src=""/>
<n-image width="90" src=""/>
<n-image width="90" src=""/>
</n-space>
</n-image-group>
</n-card>
</template>
为啥还这么多错的?
<template>
<div class="news-list">
<n-card title="">
<n-image-group>
<n-space>
<n-image width="90" :src="newsMsg.thumbnail_pic_s" />
<n-image width="90" :src="newsMsg.thumbnail_pic_s02" />
<n-image width="90" :src="newsMsg.thumbnail_pic_s03" />
</n-space>
</n-image-group>
</n-card>
</div>
</template>
<script lang="ts">
import { Options, Vue } from "vue-class-component";
import { NCard, NImageGroup, NImage, NSpace } from 'naive-ui';
import axios from "axios";
@Options({
components: {
NCard,
NImageGroup,
NImage,
NSpace
},
})
export default class NewsList extends Vue {
private newsApiUrl:string = "http://v.juhe.cn/toutiao/index?tpye=";
private alias:string = "top";
private key:string = "&key=af5d5f0719c063d4b3db6999e537a305";
mounted() {
this.getDate();
}
getData() {
axios
.get(this.newsApiUrl + this.alias + this.key)
.then(response) => (this.news = response.data.result.data));
}
}
</script>
|