vue循环组件
效果图展示<el-timeline v-for="(item,index) in items" v-bind:key="index"><el-timeline-item :timestamp="(items[index].create_time)" placement="top"><el-card><h4>{{items[index].title}}
·
效果图展示
<el-timeline v-for="(item,index) in items" v-bind:key="index">
<el-timeline-item :timestamp="(items[index].create_time)" placement="top">
<el-card>
<h4>{{items[index].title}}</h4>
<p>{{items[index].remarks}}</p>
</el-card>
</el-timeline-item>
</el-timeline>
export default {
data: () => ({
items:[],
})
数据存到items里面
show(){
axios
.post(`${config.API_URL}/#`, {
}).then((result) => {
for (let i = 0; i < result.data.data.length; i++) {
this.items[i] = result.data.data[i];
console.log(result.data.data[i]);
}
})
.catch((err) => {
console.log("捕获异常", err);
});
}
更多推荐
已为社区贡献1条内容
所有评论(0)