`I have an api that pulls data from 2 tables in my sql database. Get, post, put, delete functions work with the help of swagger. But I’m having trouble connecting this project to vue.js.
The directory of the codes I wrote is as follows:
`HospitalProject(This project is on my desktop)
│
├── vue
│ ├── src
│ │ ├── components
│ │ │ └── DoctorHospitalManagement.vue
│ │ ├── router
│ │ │ └── index.js
│ │ ├── App.vue
│ │ └── main.js
│ └── public
│ └── index.html
│
└── api
├── Controllers
│ ├── DoctorController.cs
│ └── HospitalController.cs
└── …
Here is my index.js file:
` import Vue from ‘vue’
import VueRouter from ‘vue-router’
import DoctorHospitalManagement from ‘../components/DoctorHospitalManagement.vue’
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'DoctorHospitalManagement',
component: DoctorHospitalManagement
}
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes
})
export default router
`
“ERROR in ./src/router/index.js 3:0-81
I get the warning “Module not found: Error: Can’t resolve”. I have checked the directory many times, but it still says it is not correct.
Sinem Çalışkan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.