Update editor to use modelValue for Vue 3#4
Update editor to use modelValue for Vue 3#4jourdain merged 5 commits intoKitware:masterfrom MattTheCuber:vue3-fix
Conversation
There was a problem hiding this comment.
A solution for the double input event call would be to remove it in favor of just using the modeValue?
There was a problem hiding this comment.
To skip the double update, just keep the last sent value in a local var and just skip the emit if same as before.
this.editor.onDidChangeModelContent(() => {
const newValue = this.editor.getValue();
if (this.lastValue === newValue) {
return;
}
this.lastValue = newValue;
this.$emit("update:modelValue", newValue);
this.$emit("input", newValue);
}
There was a problem hiding this comment.
This still seems to occur...
I set input="console.log($event)", and in the console it first prints the contents then and InputEvent.
|
Thanks for the PR but now you are removing vue2 compatibility with v-model. Can you keep both |
Closes #3
Fixes value not being 2-way bound, does not fix
inputbeing triggered twice.Tested here.
chrome_IO5KxNLy4e.mp4