notice.vue 862 Bytes
<template>
    <el-empty v-if="state.noticeList && state.noticeList.length == 0" description="暂无消息" />
    <div v-else v-for="item in state.noticeList" class="notice_wrap">
        <div class="con">{{item.message}}</div>
        <div class="time">{{item.createTime}}</div>
    </div>
</template>

<script setup lang="ts">
    import * as api from "./../../interface/api"

    let state = reactive({
        noticeList: []
    })

    api.getNotice().then(res=> {
        state.noticeList = res.rows
    })

    const arrowPath = ref("/")
    defineExpose({arrowPath})
</script>

<style scoped>
    .notice_wrap {
        background-color: #FFFFFF;
        margin: 10px 20px;
        padding: 20px;
        .con {
            text-indent: 2em;
            font-size: 16px;
        }
        .time {
            text-align: right;
        }
    }
</style>