diff --git a/src/components/preview/SimTextPreview.vue b/src/components/preview/SimTextPreview.vue index 9e81be9..a29b6f0 100644 --- a/src/components/preview/SimTextPreview.vue +++ b/src/components/preview/SimTextPreview.vue @@ -66,7 +66,7 @@
-
+
-
+
- +
@@ -181,6 +181,7 @@ defalutLanguage: 'redis', lineWrapping: false, moblie: false, + panelReadOnly: true, options: { fontSize: 14, contextmenu: true, @@ -358,6 +359,8 @@ }, async requestStream(request, params, index) { try { + const readOnly = this.panelReadOnly + this.options.readOnly = true this.abortControllerAbort(index) const queryString = this.buildQueryString(params); let url = "/api/preview/text/stream" @@ -386,6 +389,7 @@ throttledUpdateContent.cancel(); this.content = result; this.setEditMap(index, this.content) + this.options.readOnly = readOnly return; } result += decoder.decode(value, { stream: true }); @@ -648,11 +652,13 @@ checkReadOnly(fileUserId){ if(this.$store.state.user.token && this.$store.state.user.userId === fileUserId){ this.options.readOnly = false + this.panelReadOnly = false } if (!this.$pc) { this.options.readOnly = true + this.panelReadOnly = false } - if(this.options.readOnly || this.moblie){ + if(this.panelReadOnly || this.moblie){ this.$nextTick(()=> { this.editorWidth += this.contentsWidth this.contentsHide = true