[Vuejs]-Issue when I try to use lazyload with vuejs

0👍

Your error code says

Module not found: Error: Can't resolve '../views'

This means that your relative directory in return() => import('../views/${view}.vue') is not correct. Correct your relative directory and it will work.

For example return() => import('@/views/${view}.vue') should work assuming that your folder structure is the default

+ src
|--+ Assets 
|--+ Components
|--+ Views

Because @ is a reference to /src therefore @/Assets is the same as /src/Assets thanks to webpack’s resolve feature. https://stackoverflow.com/a/42753045/2073738

Leave a comment