info.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <el-dialog
  3. title="流程数据信息"
  4. :visible.sync="dialogVisible"
  5. width="70%"
  6. >
  7. <el-alert
  8. title="使用说明"
  9. type="warning"
  10. description="以下流程信息可以被存储起来,方便下一次流程加载"
  11. show-icon
  12. close-text="知道了"
  13. >
  14. </el-alert>
  15. <br/>
  16. <!--一个高亮显示的插件-->
  17. <codemirror
  18. :value="flowJsonData"
  19. :options="options"
  20. class="code"
  21. ></codemirror>
  22. </el-dialog>
  23. </template>
  24. <script>
  25. import 'codemirror/lib/codemirror.css'
  26. import { codemirror } from 'vue-codemirror'
  27. require("codemirror/mode/javascript/javascript.js")
  28. export default {
  29. props: {
  30. data: Object,
  31. },
  32. data() {
  33. return {
  34. dialogVisible: false,
  35. flowJsonData: {},
  36. options: {
  37. mode: {name: "javascript", json: true},
  38. lineNumbers: true
  39. }
  40. }
  41. },
  42. components: {
  43. codemirror
  44. },
  45. methods: {
  46. init() {
  47. this.dialogVisible = true
  48. this.flowJsonData = JSON.stringify(this.data, null, 4).toString()
  49. }
  50. }
  51. }
  52. </script>