Open arshivbastian opened 5 years ago
for creating new rout in vue.cli project you need to open these two files :
src/router.js src/App.vue
also you need to create a new file with your favorite name on this directory : src/views/filename.vue
src/views/filename.vue
before starting changes first check you have this lines in src/main.js (or main.ts)
--> now lets head to src/router.js and add these lines :
src/router.js
{ path: '/link_address', name: 'name', component: () => import('./views/a_vue_file_name_in_views') }
like picture :
--> create a file in view directory with exact name that we have mentioned in main.js :
--> now create a link for our route in App.vue for user to be able to switch between routes :
App.vue
now make some changes in your new view :
Creating rout
for creating new rout in vue.cli project you need to open these two files :
also you need to create a new file with your favorite name on this directory :
src/views/filename.vue
before starting changes first check you have this lines in src/main.js (or main.ts)
--> now lets head to
src/router.js
and add these lines :like picture :
--> create a file in view directory with exact name that we have mentioned in main.js :
--> now create a link for our route in
App.vue
for user to be able to switch between routes :now make some changes in your new view :