<div class="content_top">
<div class="content_one_return" @click="back()">
<img src="..\assets\左箭头.png" alt />
</div>
<div class="content_one_article">文章详情</div>
<div class="clear"></div>
</div>
<div class="content_one_title">{{article.total_title}}</div>
<div class="content_one_editor">
<div class="content_one_name">{{article.total_author}}</div>
<div class="content_one_time">{{article.total_time}}</div>
<div class="clear"></div>
</div>
<div class="text1" v-html="article.total_content">
</div>
<script>
export default {
name: "Content",
components: {},
data() {
return {
total_id: '',
article:'',
};
},
mounted() {//自动运行,顺序自上而下
this.total_id= this.$route.query.total_id;
this.contentes();
// console.log(this.$route.query)
},
methods: {
back() {
this.$router.go(-1);//返回上一页
},
contentes() {
let obj={
total_id:this.total_id
};
this.$http//固定写法
.post("/api/total/detail",obj)
.then(res=>{
console.log(res)
this.article= res.data.result.data[0]
}
).catch(err => {});
}
}
};
</script>