<template>
  <voteCard :title="'小区公告'" @click="goMore">
    <van-skeleton  :row="3" :loading="loading">
      <announcementItem v-for="(item,index) in list" :key="index" :params="item" class="announcementItem"></announcementItem>
    </van-skeleton>

  </voteCard>
</template>

<script>
import voteCard from "@/views/Home/module/voteCard";
import announcementItem from "@/views/Home/module/announcementItem";
export default {
  name: "announcement",
  components:{
    voteCard,announcementItem
  },
  data(){
    return {
      loading:true,
      list:[],
    }
  },
  mounted() {
    this.getNotices();
  },
  methods:{
    getNotices(){
      let params = {
        type:'1',
        page:1,
        pageCapacity:3
      }
      this.$api.getNotices(params).then(res=>{
        this.loading = false
        this.list = res.content.list
      })
    },
    goMore(){
      this.$router.push({name:'announcementList'})
    },
  }
}
</script>

<style scoped>
.announcementItem{
  margin-top: 15px;
}
</style>