<template>
  <view>
    <template v-if="list.length">
      <u-list>
        <u-list-item v-for="(item, index) in list" :key="index">
          <u-cell :title="item.title" is-link :url="`/userPages/pages/article?id=${item.articleId}`" :label="item.createTime"></u-cell>
        </u-list-item>
      </u-list>
    </template>
    <u-empty v-else text="暂无文章"/>
  </view>
</template>

<script>
import {listArticleReq} from "@/api/common";

export default {
  name: "articleList",
  data() {
    return {
      cateId: null,
      list: []
    }
  },
  methods: {
    async getList() {
      const {data} = await listArticleReq()
      this.list = data
    }
  },
  onLoad({id}) {
    this.getList()
  }
}
</script>