3f9d6ea331ed3668f41017691018618e.json 4.2 KB

1
  1. {"remainingRequest":"D:\\cloud\\template\\demo-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\cloud\\template\\demo-ui\\src\\components\\editor\\index.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\cloud\\template\\demo-ui\\src\\components\\editor\\index.vue","mtime":1619070292866},{"path":"D:\\cloud\\template\\demo-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\cloud\\template\\demo-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\cloud\\template\\demo-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\cloud\\template\\demo-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n\nimport CodeMirror from 'codemirror'\nimport 'codemirror/lib/codemirror.css'\n// 替换主题这里需修改名称\nimport 'codemirror/theme/idea.css'\nimport 'codemirror/mode/clike/clike'\nexport default {\n props: {\n value: {\n type: String,\n required: true\n },\n height: {\n type: String,\n required: true\n }\n },\n data() {\n return {\n editor: false\n }\n },\n watch: {\n value(value) {\n const editorValue = this.editor.getValue()\n if (value !== editorValue) {\n this.editor.setValue(this.value)\n }\n },\n height(value) {\n this.editor.setSize('auto', this.height)\n }\n },\n mounted() {\n this.editor = CodeMirror.fromTextArea(this.$refs.textarea, {\n mode: 'text/x-java',\n lineNumbers: true,\n lint: true,\n lineWrapping: true,\n tabSize: 2,\n cursorHeight: 0.9,\n // 替换主题这里需修改名称\n theme: 'idea',\n readOnly: true\n })\n this.editor.setSize('auto', this.height)\n this.editor.setValue(this.value)\n },\n methods: {\n getValue() {\n return this.editor.getValue()\n }\n }\n}\n",{"version":3,"sources":["index.vue"],"names":[],"mappings":";;;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.vue","sourceRoot":"src/components/editor","sourcesContent":["<template>\r\n <div class=\"json-editor\">\r\n <textarea ref=\"textarea\" />\r\n </div>\r\n</template>\r\n\r\n<script>\r\n import CodeMirror from 'codemirror'\r\n import 'codemirror/lib/codemirror.css'\r\n // 替换主题这里需修改名称\r\n import 'codemirror/theme/idea.css'\r\n import 'codemirror/mode/clike/clike'\r\n export default {\r\n props: {\r\n value: {\r\n type: String,\r\n required: true\r\n },\r\n height: {\r\n type: String,\r\n required: true\r\n }\r\n },\r\n data() {\r\n return {\r\n editor: false\r\n }\r\n },\r\n watch: {\r\n value(value) {\r\n const editorValue = this.editor.getValue()\r\n if (value !== editorValue) {\r\n this.editor.setValue(this.value)\r\n }\r\n },\r\n height(value) {\r\n this.editor.setSize('auto', this.height)\r\n }\r\n },\r\n mounted() {\r\n this.editor = CodeMirror.fromTextArea(this.$refs.textarea, {\r\n mode: 'text/x-java',\r\n lineNumbers: true,\r\n lint: true,\r\n lineWrapping: true,\r\n tabSize: 2,\r\n cursorHeight: 0.9,\r\n // 替换主题这里需修改名称\r\n theme: 'idea',\r\n readOnly: true\r\n })\r\n this.editor.setSize('auto', this.height)\r\n this.editor.setValue(this.value)\r\n },\r\n methods: {\r\n getValue() {\r\n return this.editor.getValue()\r\n }\r\n }\r\n }\r\n</script>\r\n\r\n<style scoped>\r\n .json-editor{\r\n height: 100%;\r\n margin-bottom: 10px;\r\n }\r\n .json-editor >>> .CodeMirror {\r\n font-size: 14px;\r\n overflow-y:auto;\r\n font-weight:normal\r\n }\r\n .json-editor >>> .CodeMirror-scroll{\r\n }\r\n .json-editor >>> .cm-s-rubyblue span.cm-string {\r\n color: #F08047;\r\n }\r\n</style>\r\n"]}]}