Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

Added v-model support to ace-editor

Andrew Bastin2360803e44e7
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: {