From 363e9da03ed1499a590f080d286f1c36cb09111c Mon Sep 17 00:00:00 2001
From: heimawl <1785969728@qq.com>
Date: 星期一, 26 六月 2023 15:12:18 +0800
Subject: [PATCH] 更改编辑器样式

---
 src/views/Intelligentcenter/centercontrol/index.vue |   46 +++++++++++++++++++++++++++++++++++++---------
 1 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/src/views/Intelligentcenter/centercontrol/index.vue b/src/views/Intelligentcenter/centercontrol/index.vue
index 88eee60..e8b772b 100644
--- a/src/views/Intelligentcenter/centercontrol/index.vue
+++ b/src/views/Intelligentcenter/centercontrol/index.vue
@@ -76,16 +76,37 @@
           </el-tab-pane>
         </el-tabs>
       </div>
+      <div class="leftvalu-code">
+        <codemirror v-model="code" :options="options"></codemirror>
+      </div>
     </div>
   </div>
 </template>
 
 <script>
+// import { codemirror } from "vue-codemirror";
 export default {
   name: "education",
 
   data() {
     return {
+      code: "",
+      options: {
+        line: true,
+        theme: "rubyblue", // 涓婚
+        tabSize: 4, // 鍒惰〃绗︾殑瀹藉害
+        indentUnit: 2, // 涓�涓潡搴旇缂╄繘澶氬皯涓┖鏍硷紙鏃犺杩欏湪缂栬緫璇█涓剰鍛崇潃浠�涔堬級銆傞粯璁ゅ�间负 2銆�
+        firstLineNumber: 1, // 浠庡摢涓暟瀛楀紑濮嬭绠楄鏁般�傞粯璁ゅ�间负 1銆�
+        readOnly: false, // 鍙
+        autorefresh: true,
+        smartIndent: true, // 涓婁笅鏂囩缉杩�
+        lineNumbers: true, // 鏄惁鏄剧ず琛屽彿
+        styleActiveLine: true, // 楂樹寒閫変腑琛�
+        viewportMargin: Infinity, //澶勭悊楂樺害鑷�傚簲鏃舵惌閰嶄娇鐢�
+        showCursorWhenSelecting: true, // 褰撻�夋嫨澶勪簬娲诲姩鐘舵�佹椂鏄惁搴旂粯鍒舵父鏍�
+        mode: "javascript",
+      },
+
       editableTabsValue: "2-2-3",
       editableTabslist: [
         {
@@ -143,24 +164,19 @@
       });
 
       var results = this.editableTabs.some(function (item) {
-        if (item.name == "寮犱笁") {
+        if (item.name == key) {
           //item.name == "鐜嬮夯瀛�"
           return true; //杩斿洖false
         }
       });
-      this.editableTabs.push(result);
+      if (!results) {
+        this.editableTabs.push(result);
+      }
       this.editableTabsValue = key;
       console.log(result);
     },
     handleTabsEdit(targetName, action) {
       if (action === "add") {
-        let newTabName = ++this.tabIndex + "";
-        this.editableTabs.push({
-          title: "New Tab",
-          name: newTabName,
-          content: "New Tab content",
-        });
-        this.editableTabsValue = newTabName;
       }
       if (action === "remove") {
         let tabs = this.editableTabs;
@@ -187,6 +203,17 @@
 <style lang="scss" scoped>
 .educationmanagement {
   display: flex;
+}
+.leftvalu-code {
+  // background: #3a3d42;
+  height: 300px;
+  ::v-deep.CodeMirror {
+    position: relative;
+    overflow: hidden;
+    // background: #3a3d42;
+    color: #3a92ef;
+    font-size: 20px;
+  }
 }
 .sidecolumn {
   width: 300px;
@@ -224,6 +251,7 @@
     display: center !important;
   }
 }
+
 .qrcode-dialo {
   text-align: center;
   //   display: flex;

--
Gitblit v1.9.3