zxl
4 天以前 934654b44fb2670a7ce08aafa3d1d85fe783ae26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<template>
  <div class="box">
    <div class="wrapper">
      <div class="nav" @click="back">
        <img src="@/assets/images/logo2.png" alt="" class="logo" />
        <div class="title">{{ detail.title }}</div>
      </div>
      <div v-html="detail.content"></div>
    </div>
  </div>
</template>
 
<script>
import { articleDetail } from "@/api/common.js";
const config = require("@/config/index");
export default {
  data() {
    return {
      config,
      detail: "",
    };
  },
  mounted() {
    this.init();
  },
  methods: {
    back() {
      this.$router.push("/");
    },
    // 初始化文章
    init() {
      const id = this.$route.query.id;
 
      articleDetail(id).then((res) => {
        if (res.success) {
          this.detail = res.result;
        }
      });
    },
  },
};
</script>
 
<style lang="scss" scoped>
.logo {
  max-width: 200px;
}
.box {
  min-height: 100vh;
  width: 1200px;
  overflow: hidden;
  margin: 0 auto;
  padding: 32px;
}
.wrapper {
  width: 1200px;
  min-height: 600px;
  padding: 32px;
  background: #fff;
}
.nav {
  text-align: center;
  font-size: 21px;
  font-weight: bold;
}
.title {
  text-align: center;
 
  font-size: 21px;
  margin: 20px 0;
}
 
// iphone
@media screen and (max-width: 767px) {
  .box {
    min-height: 100vh;
    width: 100%;
    padding: 0;
    margin: 0 auto;
  }
  .wrapper {
    width: 100%;
    min-height: 600px;
    padding: 0 16px;
    background: #fff;
  }
}
</style>