diff --git a/components/ace-editor.vue b/components/ace-editor.vue index a07aa2606..a54e4c241 100644 --- a/components/ace-editor.vue +++ b/components/ace-editor.vue @@ -60,10 +60,16 @@ export default { ...this.options }); - editor.setValue(this.value); + if (this.value) editor.setValue(this.value, 1); this.editor = editor; this.cacheValue = this.value; + + editor.on('change', () => { + const content = editor.getValue(); + this.$emit("input", content); + this.cacheValue = content; + }); }, methods: { diff --git a/pages/graphql.vue b/pages/graphql.vue index 20070b16b..be61af9a2 100644 --- a/pages/graphql.vue +++ b/pages/graphql.vue @@ -171,7 +171,17 @@ - +
diff --git a/pages/index.vue b/pages/index.vue index ca978d813..4e0f00ea1 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -24,14 +24,18 @@
- + :lang="'javascript'" + :options="{ + maxLines: responseBodyMaxLines, + minLines: '16', + fontSize: '16px', + autoScrollEditorIntoView: true, + showPrintMargin: false, + useWorker: false + }" + />
@@ -626,7 +630,7 @@
- import("../components/collections"), saveRequestAs: () => import("../components/collections/saveRequestAs"), - ResponseBody: AceEditor + Editor: AceEditor }, data() { return { showModal: false, showPreRequestScript: false, - preRequestScript: "", + preRequestScript: "// pw.env.set('variable', 'value');", copyButton: 'file_copy', downloadButton: 'get_app', doneButton: 'done',