You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cesuan/pages/articlelist/articlelist.vue

60 lines
1.0 KiB

1 year ago
<template>
<view class="container">
<view class="item" @click="jumdetail(item.article_id)" v-for="item in list">
<view><img :src="item.image" alt=""></view>
<view>
<view>{{item.title}}</view>
<view>{{item.created_at}}</view>
</view>
</view>
</view>
</template>
<script>
import * as Api from '@/api/page'
export default {
data() {
return {
list:[
{
"article_id": 1,
"title": "啦啦啦啦111",
"image": "https://measure.njrenzhou.cn/images/none.png",
"created_at": "2023-07-21T13:05:22.000000Z"
}
],
}
},
onLoad(options)
{
if(options.cat_id)
{
Api.knowledgeList({category_id:options.cat_id})
.then(result => {
this.list = result.data;
console.log(this.list);
})
}
},
methods: {
jumdetail(article_id)
{
this.$navTo('pages/articledetail/articledetail',{article_id:article_id});
}
}
}
</script>
<style>
.container
{
background-color: #fefefe;
padding:20rpx 30rpx;
}
</style>