My current approach involves utilizing a setup()
method to bring in an external component that exclusively supports the Options API. Once I have imported this component, I need to set it up using the Options API data
.
The challenge I face is accessing the returned ref
values from the setup()
function within the Options API's data
section. Here is what I am trying to accomplish:
setup() {
const IsBrowser = typeof window !== 'undefined';
let EssentialsPlugin = ref(null);
if (IsBrowser) {
import('@ckeditor/ckeditor5-essentials/src/essentials').then(module => EssentialsPlugin.value = module);
}
return {
EssentialsPlugin
},
data() {
return {
CKEditorConfig: {
plugins: [
EssentialsPlugin // The EssentialsPlugin should come from the setup()
]
However, when executing the above code, I encounter the error:
Uncaught (in promise) ReferenceError: EssentialsPlugin is not defined
.
Given that CKEditor5
only functions with the Options API in Vue and does not support Composition API for the foreseeable future, how can I configure it in the Options API while incorporating ref values obtained from the Composition API's setup()
?