I'm trying to implement the recommendation of this article on component dynamic import:
Template:
<component :is="componentLoader" />
Script:
computed: {
componentLoader () {
const modalComponent = 'HeroBanner'
return () => import(`@/components/template-ux/${modalComponent}.vue`)
}
}
But I'm getting an error:
Cannot read property 'value' of null - Occurred while linting D:\projects\my-project\components\global\Modal.vue:41
What is causing this issue?
EDIT: line #41 is the line starting with return () => import...