Преглед изворни кода

fix(workPage): 优化保存延迟和问题输入框样式

将保存延迟从500ms减少到300ms以提高响应速度
替换contenteditable div为el-input textarea并调整样式,提升输入体验
SanHQin пре 3 дана
родитељ
комит
1118f8ab65

+ 18 - 5
src/components/pages/workPage/components/setQuestionsAndAnswers.vue

@@ -6,8 +6,7 @@
       </div>
       </div>
 
 
       <div class="ti_title">
       <div class="ti_title">
-        <div class="ti_t_input" contenteditable="true" v-text="jsonData.answerQ"
-          @input="setTestTitle($event.target.innerText)"></div>
+        <el-input class="ti_t_input" type="textarea" v-model="jsonData.answerQ" @input="setTestTitle"></el-input>
         <div class="uploadImage" @click="uploadImage()">
         <div class="uploadImage" @click="uploadImage()">
           <svg viewBox="0 0 1024 1024" version="1.1" p-id="15953" width="200" height="200">
           <svg viewBox="0 0 1024 1024" version="1.1" p-id="15953" width="200" height="200">
             <path
             <path
@@ -265,13 +264,27 @@ export default {
   border: none;
   border: none;
   outline: none;
   outline: none;
   background: none;
   background: none;
-  font-size: .8rem;
+  font-size: 1.2rem;
   resize: none;
   resize: none;
-  max-height:10rem;
-  overflow:auto;
+  /* max-height: 10rem; */
+  overflow: auto;
   /* padding-right: 2rem; */
   /* padding-right: 2rem; */
 }
 }
 
 
+.ti_t_input /deep/ .el-textarea__inner {
+  padding: 0;
+  width: 100%;
+  height: 100%;
+  box-sizing: border-box;
+  border: none;
+  outline: none;
+  background: none;
+  font-size: 1.2rem;
+  resize: none;
+  /* max-height: 10rem; */
+  overflow: auto;
+}
+
 .uploadImage {
 .uploadImage {
   position: absolute;
   position: absolute;
   bottom: 0.5rem;
   bottom: 0.5rem;

+ 1 - 1
src/components/pages/workPage/setIndex.vue

@@ -101,7 +101,7 @@ export default {
         console.log("保存失败",err);
         console.log("保存失败",err);
         // this.$message.error("保存失败");
         // this.$message.error("保存失败");
       })
       })
-    }, 500)
+    }, 300)
   },
   },
   mounted() {
   mounted() {
     this.getWorkData();
     this.getWorkData();