info.vue 1.79 KB
<template>
  <div class="app-container">
    <el-row>
      <el-col :offset="3" :span="18">
        <h1 class="info_title">{{ info.title }}</h1>
      </el-col>
    </el-row>
    <el-row>
      <el-col :offset="3" :span="18">
        <div class="info_author">
          <span>作者:</span><span>{{ info.createBy }}</span>
          <span>发表时间:</span><span>{{ info.createTime }}</span>
        </div>
      </el-col>
    </el-row>
    <el-row>
      <el-col :offset="3" :span="18">
        <div class="info_content ql-editor" v-html="info.content"></div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import {
  addDocumentData,
  delDocumentData,
  exportDocumentData,
  getDocumentData,
  listDocumentData,
  updateDocumentData
} from "@/api/other/documentData";
import Editor from '@/components/2cEditor';
import "quill/dist/quill.core.css";
import {parseTime} from "../../../utils/trash";

export default {
  name: "DocumentData",
  components: {Editor},
  data() {
    return {
      // 遮罩层
      loading: true,
      info: {
        title:null,
        createBy:null,
        createTime:null,
        content:null
      },
    };
  },
  created() {
    this.initData();
  },
  watch:{
    '$route.query.documentData':'initData'
  },
  methods: {
    initData(){
      if(this.$route.query.documentData){
        this.info = this.$route.query.documentData;
      }

    }
  }
};
</script>
<style lang="scss" scoped>
.info_title{
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}
.info_author{
  display: flex;
  justify-content: center;
  align-items: center;
  height: 26px;
  font-size:14px;
  color: #616977;
  border-bottom: 1px solid #ddd;
  box-shadow: 0px 20px 20px -20px #5E5E5E;
}
.info_author span:nth-child(2){
  margin-right: 20px;
}
</style>