Added v-model support to ace-editor

This commit is contained in:
Andrew Bastin
2019-11-30 02:08:09 -05:00
parent 3f5752247b
commit 2360803e44

View File

@@ -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: {