[Vuejs]-Calling async componets inside a component in Vuejs though axios call

0๐Ÿ‘

โœ…

I think you almost got the answer yourself. The error log probably says that import(val.location) is importing an dependency but the dependency is an expression. So you should replace it with a name instead, like you did in your experiment.

Also, I am not sure if it is necessary to asynchronously import the two components (PageTitle and TopSellerWidget) inside Dashboard. Dashboard itself is already loaded asynchronously, so any of its dependencies, such as PageTitle is also loaded only when you request Dashboard. And since you need both PageTitle and TopSellerWidget to properly render your Dashboard, you may as well get them along with Dashboard, rather than spending one more round trip on the wire.

Leave a comment