Explorar o código

富文本编辑组件支持只读

RuoYi %!s(int64=5) %!d(string=hai) anos
pai
achega
0922410a22
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      ruoyi-ui/src/components/Editor/index.vue

+ 7 - 2
ruoyi-ui/src/components/Editor/index.vue

@@ -26,6 +26,11 @@ export default {
26
       type: Number,
26
       type: Number,
27
       default: null,
27
       default: null,
28
     },
28
     },
29
+    /* 只读 */
30
+    readOnly: {
31
+      type: Boolean,
32
+      default: false,
33
+    }
29
   },
34
   },
30
   data() {
35
   data() {
31
     return {
36
     return {
@@ -51,7 +56,7 @@ export default {
51
           ],
56
           ],
52
         },
57
         },
53
         placeholder: "请输入内容",
58
         placeholder: "请输入内容",
54
-        readOnly: false,
59
+        readOnly: this.readOnly,
55
       },
60
       },
56
     };
61
     };
57
   },
62
   },
@@ -192,4 +197,4 @@ export default {
192
 .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
197
 .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
193
   content: "等宽字体";
198
   content: "等宽字体";
194
 }
199
 }
195
-</style>
200
+</style>