87 lines
1.6 KiB
Vue
87 lines
1.6 KiB
Vue
<template>
|
|
<div class="News">
|
|
<toubu></toubu>
|
|
<div class="zhengwen">
|
|
<div class="tittle">{{ list.tittle }}</div>
|
|
<div class="time">
|
|
<span>{{ item.creatTime }}</span>
|
|
<span> 阅读量{{ list.browse }} </span>
|
|
</div>
|
|
<div class="content">
|
|
{{ list.content }}
|
|
</div>
|
|
<div class="footer">
|
|
<img src="@sta/select-down.png" class="sel" alt="" />
|
|
<img src="@sta/open.png" class="open" alt="" />
|
|
</div>
|
|
</div>
|
|
<comment></comment>
|
|
<discuss></discuss>
|
|
</div>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
import toubu from "@/components/toubu";
|
|
import comment from "@/components/comment";
|
|
import discuss from "@/components/discuss";
|
|
|
|
export default {
|
|
name: "news",
|
|
data() {
|
|
return {
|
|
list: {},
|
|
status: false, //flase未超过高度 true 超过高度
|
|
};
|
|
},
|
|
|
|
created() {
|
|
this.getNews();
|
|
},
|
|
|
|
mounted() {
|
|
console.log(this.list);
|
|
this.list.forEach((item) => {
|
|
var date = new Date(item.creatTime);
|
|
console.log("date", date);
|
|
item.creatTime = `${date.getFullYear()}-${
|
|
date.getMonth() + 1
|
|
}-${date.getDate()}`;
|
|
});
|
|
},
|
|
|
|
methods: {
|
|
async getNews() {
|
|
this.list = await this.$http.index.news();
|
|
},
|
|
},
|
|
};
|
|
|
|
components: {
|
|
toubu, comment, discuss;
|
|
}
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less">
|
|
.content {
|
|
width: auto;
|
|
height: 15.08rem;
|
|
font-family: PingFang-SC-Medium;
|
|
font-size: 0.427rem;
|
|
line-height: 0.667rem;
|
|
color: #000000;
|
|
}
|
|
|
|
.footer {
|
|
position: fixed;
|
|
bottom: 0rem;
|
|
}
|
|
.sel {
|
|
width: 0.693rem;
|
|
height: 0rem;
|
|
position: fixed;
|
|
top: 17.133rem;
|
|
left: 4.667rem;
|
|
}
|
|
</style> |