I am quite new to VueJs. I dynamically import and render .vue component. But when I do that vue warning display like this,
[Vue warn]: Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.
Component that was made reactive:
But after I markRaw or shallowRef the import item, component not display.
template....
<div class="card-content padding-horizontal padding-top">
<div class="terms-block scrolling">
<div ref="content">
<component :is="dynamicStatementComponent" />
</div>
</div>
</div>
script....
data() {
return {
importedModule: null
}
},
computed: {
dynamicStatementComponent() {
let filePath;
import(filePath)
.then((module) => {
this.importedModule = markRaw(module.default);
})
.catch(() => {
});
return this.importedModule;
}
}