[Vuejs]-Dynamic VueRouter imports for named Views using Promisses

1👍

It’s because then also returns promise.

You code looks strange so its hard to tell what you are trying to do but generally when using dynamic imports Vue expects a function returning promise

So change

filter_menu_view: import(`../../${this._filter_menu_view_path}.vue`).then((resolve) => resolve)

for

filter_menu_view: () => import(`../../${this._filter_menu_view_path}.vue`)

…you are creating a function which returns a promise (of component). Vue will call the function when component is needed and wait for promise to resolve to use the component returned by import

Edit

Oh yeah, and if your are trying to use named views, the key is components, not component

Leave a comment