-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'setData' of undefined #167
Comments
Hi, thanks for the report. Could you please provide some more precise steps + code to reproduce this error? Also, does this error occur only when trying to set data taken from the server, and not with other content? |
For anyone coming across this in future; there seems to be an issue with assigning a value to ckeditor in the 'mounted' hook. setTimeout(() => {
this.editorValue = 'New Value';
}, 100); |
@ConnorHowell the setTimeout worked. thank you for saving me hours of frustrations. <ckeditor @ready="onEditorReady" v-model="editorValue"></ckeditor> in methods methods: {
onEditorReady: function() { this.editorValue = 'New Value'; }
} |
@bizsimon good point, guessing the permanent fix to this issue would be for the component to check the instance exists prior to assigning the value in the watcher for 'modelValue': Lines 123 to 125 in 3ee73df
@pomek do you want a PR for this, seems like a fairly trivial fix? |
I have created a component that uses the CKEditor inside
editorValue is bean updated from the watcher: this was triggering the error when the component was accessed for second time so i solved it by including 2 new variables: ready and tempValue the editorReady become: the watcher changes to: so instead of using a setTimeout i change the value of the ckeditor when the editor is ready. hope this will help someone |
how can i save editorData as a prop in vuejs?
i have a laravel backend and i need send product->description as props to ckeditor
my code:
mounted() { if(this.mainData){ this.editorData = this.mainData } },
but i have these error:
[Vue warn]: Error in callback for watcher "value": "TypeError: Cannot read property 'setData' of undefined"
The text was updated successfully, but these errors were encountered: