<template>
  <div>
    <Nav title="我的浏览" />
    <div class="list">
      <Item v-for="(item, index) in list" :item="item" :key="index" />
      <Empty v-if="!list.length" text="暂无浏览～" />
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import Nav from "@/components/NavBar.vue";
import Item from "./components/Item.vue";
import { getSubscribeList } from "@/api/index";

const list = ref([]);
const onLoad = async () => {
  // 异步更新数据
  let ret = await getSubscribeList({ type: 2 });
  if (ret.code === 0) {
    list.value = ret.data;
  }
};
onLoad();
</script>
<style scoped lang="scss">
.info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #666666;
  font-family: "PingFang SC";
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: 32px;
  padding-bottom: 20px;
  .user {
    display: flex;
    align-items: center;
    img {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      margin-right: 8px;
    }
  }
}
.list {
  padding: 0 32px;
}
</style>
