|
@@ -0,0 +1,54 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div v-loading="loading">
|
|
|
|
|
+ <div class="white-box">
|
|
|
|
|
+ <div class="white-box-title">
|
|
|
|
|
+ <h1>{{ title }}</h1>
|
|
|
|
|
+ <span>{{ createdAt | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-html="content" class="white-box-content">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import {fetchArticleOne} from "@/api/article"
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: 'detail',
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ this.getData()
|
|
|
|
|
+ },
|
|
|
|
|
+ data () {
|
|
|
|
|
+ return {
|
|
|
|
|
+ title: null,
|
|
|
|
|
+ content: null,
|
|
|
|
|
+ createdAt: '',
|
|
|
|
|
+ loading: true,
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ handleCurrentChange(page) {
|
|
|
|
|
+ this.getData(page, this.pageSize)
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSizeChange(pageSize) {
|
|
|
|
|
+ this.getData(this.currentPage, pageSize)
|
|
|
|
|
+ },
|
|
|
|
|
+ getData() {
|
|
|
|
|
+ fetchArticleOne(this.$route.params.ID).then(response => {
|
|
|
|
|
+ this.form.title = response.data.oneData.TITLE
|
|
|
|
|
+ this.form.cid = response.data.oneData.CID
|
|
|
|
|
+ this.form.content = response.data.oneData.CONTENT
|
|
|
|
|
+ this.form.sort = response.data.oneData.SORT
|
|
|
|
|
+ this.allCategory = response.data.allCategory
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped>
|
|
|
|
|
+ .white-box-title span{color: #999}
|
|
|
|
|
+ .white-box-content{font-size: 16px;padding: 15px 0;line-height: 2;}
|
|
|
|
|
+</style>
|