DataView.vue
1.18 KB
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
<template>
<el-dialog
:title="caseResultTitle"
:close-on-click-modal="false"
:visible.sync="visib"
width="70%"
:before-close="closeDialog"
>
<vue-json-editor
v-model="caseResultContent"
:show-btns="false"
:mode="'code'"
lang="zh"
class="my-editor"
@json-change="onJsonChange"
@json-save="onJsonSave"
/>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="closeDialog">关闭</el-button>
</span>
</el-dialog>
</template>
<script>
import vueJsonEditor from "vue-json-editor";
export default {
name: "Support",
components: { vueJsonEditor },
props: {
visib: {
required: true,
type: Boolean,
default: false
}
},
data() {
return {
dialogCaseResult: false,
caseResultTitle: "",
caseResultContent: null
};
},
methods: {
dataViewPreview(caseResultTitle, caseResultContent) {
this.caseResultTitle = caseResultTitle;
this.caseResultContent = caseResultContent;
},
// 关闭模态框
closeDialog() {
this.$emit("handleClose");
},
onJsonChange(value) {},
onJsonSave(value) {}
}
};
</script>