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
| <template>
| <el-dialog title="数据信息" :visible.sync="dialogVisible" width="70%">
| <el-alert
| title="使用说明"
| type="warning"
| description="以下图谱信息可以被存储起来,方便下一次数据加载"
| show-icon
| close-text="知道了"
| >
| </el-alert>
| <br />
| <!--一个高亮显示的插件-->
| <codemirror
| :value="flowJsonData"
| :options="options"
| class="code"
| ></codemirror>
| </el-dialog>
| </template>
|
| <script>
| import "codemirror/lib/codemirror.css";
| import { codemirror } from "vue-codemirror";
|
| require("codemirror/mode/javascript/javascript.js");
|
| export default {
| props: {
| data: Object
| },
| data() {
| return {
| dialogVisible: false,
| flowJsonData: {},
| options: {
| mode: { name: "javascript", json: true },
| lineNumbers: true
| }
| };
| },
| components: {
| codemirror
| },
| methods: {
| init() {
| this.dialogVisible = true;
| this.flowJsonData = JSON.stringify(this.data, null, 4).toString();
| }
| }
| };
| </script>
| <style>
| .el-dialog__body {
| padding: 30px 20px;
| color: #606266;
| font-size: 14px;
| word-break: break-all;
| text-align: left;
| }
| </style>
|
|