<template>
  <div>
    <nav-bar title="消息" :style="{ 'background-color':'#F7F7FA'}"/>
    <div class=" px-5">
      <msg v-for="i in list" :key="i.uuid" :info="i" />
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import NavBar from "@/components/NavBar/index.vue"
import msg from "@/components/Mine/Msg/index.vue"
import { getNotifyList } from '@/service/MsgService/index'

export default defineComponent({
  components:{ NavBar,msg },

  setup () {
    const list = ref([])
    const type = '2'
    const notifyList = () => {
      getNotifyList(type).then(res => {
        list.value = res.data.items
        list.value.sort((a: {update_at: number}, b: {update_at: number}) => b.update_at - a.update_at)
      })
    }
    notifyList()

    return {
      list
    }
  }
})
</script>

<style scoped>

</style>