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
| <template>
| <el-drawer
| :title="dataObj.title"
| :visible.sync="dialogVisible"
| direction="rtl"
| :before-close="onClose"
| size="980px"
| >
| <div class="drawer-content">
| <h2>{{ dataObj.title }}</h2>
| <div class="time">{{ dataObj.showTime | gettime }}</div>
| <div class="news_content">{{ dataObj.content }}</div>
| <img class="news_img" :src="dataObj.imgurl" alt="">
| </div>
| </el-drawer>
| </template>
|
| <script>
| import * as api from "@/axios/api";
| export default {
| data() {
| return {
| opt: {}, // 列表参数,必须是opt和myMixins混入配合使用
| };
| },
| props: {
| dialogVisible: {
| type: Boolean,
| default: false,
| },
| dataObj: {
| type: Object,
| default: () => {},
| },
| },
| watch: {},
| async created() {},
| methods: {
| // 关闭弹窗
| onClose() {
| this.$emit("update:dialogVisible", false);
| this.$emit("onClose"); // 关闭弹窗时,通知父组件
| },
| },
| };
| </script>
|
| <style lang="scss" scoped>
| .drawer-content {
| padding: 20px;
| height: 100%;
| display: flex;
| flex-direction: column;
| .news_img{
| width: 600px;
| height: auto;
| margin: 0 auto;
| }
| .news_content {
| margin: 20px 0;
| font-size: 16px;
| }
| .time {
| font-size: 14px;
| padding-bottom: 10px;
| border-bottom: solid 1px #ccc;
| }
| h2 {
| font-size: 20px;
| margin-bottom: 24px;
| }
|
| .pagination {
| margin-top: 20px;
| text-align: center;
| }
| }
| </style>
|
|