Added v-model support to ace-editor
This commit is contained in:
@@ -60,10 +60,16 @@ export default {
|
|||||||
...this.options
|
...this.options
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.setValue(this.value);
|
if (this.value) editor.setValue(this.value, 1);
|
||||||
|
|
||||||
this.editor = editor;
|
this.editor = editor;
|
||||||
this.cacheValue = this.value;
|
this.cacheValue = this.value;
|
||||||
|
|
||||||
|
editor.on('change', () => {
|
||||||
|
const content = editor.getValue();
|
||||||
|
this.$emit("input", content);
|
||||||
|
this.cacheValue = content;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Reference in New Issue
Block a user