完成公告、排行榜
This commit is contained in:
44
src/components/notification.vue
Normal file
44
src/components/notification.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<el-row class="row-bg" justify="center">
|
||||
<el-col :span="16">
|
||||
<el-timeline>
|
||||
<el-timeline-item center v-for="(times) in data" :timestamp="times.created_at" placement="top">
|
||||
<el-card>
|
||||
<h4>{{ times.title}}</h4>
|
||||
<p>{{times.content}}</p>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import * as dayjs from 'dayjs';
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
data:[],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
axios.get('/api/v1/notice').then(res => {
|
||||
if (res.data.code === 200) {
|
||||
console.log(res.data.data);
|
||||
this.data = res.data.data;
|
||||
this.data.forEach(function(item,index){
|
||||
item.created_at = dayjs(item.created_at).format('YYYY-MM-DD HH:mm:ss');
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
Reference in New Issue
Block a user