<template>
  <div class="app-container">
    <van-nav-bar
      title="新闻详情"
      left-arrow
      fixed
      placeholder
      @click-left="onClickLeft"
    />
    <p class="title">{{detail.title}}</p>
    <van-row style="text-align: center;margin: 0.3rem 0;">
      <van-col span="2"></van-col>
      <van-col span="10">{{detail.createTime}}</van-col>
      <van-col span="10">数据来源：{{detail.createBy}}</van-col>
      <van-col span="2"></van-col>
    </van-row>
    <div id="content"></div>
  </div>
</template>

<script>
import { newDetails } from "@/api/index";
export default {
  name: "policyDetail",
  data() {
    return {
      detail:'',
    };
  },
  created() {
    this.getList();
  },
  methods: {
    getList(){
      newDetails(this.$route.query.id).then(response => {
        console.log(response)
        this.detail = response.data
        document.getElementById('content').innerHTML = response.data.content;
      });
    },
  },
};
</script>

<style scoped lang="scss">
  .app-container {
    padding: 0.5rem 5%;
  }
  .title{
    text-align: center;
    font-size: 0.6rem;
  }
  #content{
    overflow: hidden;
  }
</style>
