1 line
2.1 KiB
JSON
1 line
2.1 KiB
JSON
{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\components\\JavaEdit\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\components\\JavaEdit\\index.vue","mtime":1732871026476},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1732872825017},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1732872825835}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n\r\nimport CodeMirror from 'codemirror'\r\nimport 'codemirror/lib/codemirror.css'\r\n// 替换主题这里需修改名称\r\nimport 'codemirror/theme/idea.css'\r\nimport 'codemirror/mode/clike/clike'\r\nexport 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",null]} |