1 |
- {"remainingRequest":"D:\\jiayue\\cemp-ui\\node_modules\\babel-loader\\lib\\index.js!D:\\jiayue\\cemp-ui\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jiayue\\cemp-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jiayue\\cemp-ui\\src\\components\\editor\\index.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jiayue\\cemp-ui\\src\\components\\editor\\index.vue","mtime":1619070292866},{"path":"D:\\jiayue\\cemp-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jiayue\\cemp-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jiayue\\cemp-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jiayue\\cemp-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\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: function data() {\n return {\n editor: false\n };\n },\n watch: {\n value: function value(_value) {\n var editorValue = this.editor.getValue();\n\n if (_value !== editorValue) {\n this.editor.setValue(this.value);\n }\n },\n height: function height(value) {\n this.editor.setSize('auto', this.height);\n }\n },\n mounted: function 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: function getValue() {\n return this.editor.getValue();\n }\n }\n};",{"version":3,"sources":["index.vue"],"names":[],"mappings":";;;;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,aAAA,KAAA,MAAA,CAAA,QAAA,EAAA;AACA;AAHA;AA1CA,CAAA","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"],"sourceRoot":"src/components/editor"}]}
|