I have an app where I load component using <router-view/>!
I am getting the problem in importing the component in router.js. It always gives me the following error:
These relative modules were not found:
* ./components/Poetry.vue in ./src/router/routes.js
* ./components/PoetryDetails/PoetryCard.vue in ./src/router/routes.js
* ./components/PoetryDetails/Search.vue in ./src/router/routes.js
I have the folder structure like this:
├── _components
| ├── _PoetryDetails
| | └──PoetryCard.vue
| | └──Search.vue
| └── Poetry.vue
├── _router
| ├── index.js (routes.js is imported in this file)
| └── routes.js
├── App.vue
└── main.js
In routes.js, I am importing the components as follows:
import Poetry from './components/Poetry.vue'
import PoetryCard from './components/PoetryDetails/PoetryCard.vue'
import PoetrySearch from './components/PoetryDetails/Search.vue'
export const routes = [
{ path: '', name: 'poetrysearch', component: Poetry, children: [
{ path: 'poetry', name: 'poetrycard', component: PoetryCard },
{ path: 'poetry/search', name: 'poetrysearch', component: PoetrySearch },
]},
]
But, I am still getting the damn error. Please help.