7👍
import { createApp } from 'vue';
import { createRouter, createWebHistory } from 'vue-router'
const routes=[
{ path:'/home', component: home },
{ path:'/zaposlenik', component: zaposlenik },
{path:'/department', component: department }
]
const router = VueRouter.createRouter({
history: VueRouter.createWebHashHistory(),
routes
})
createApp({}).use(router).mount('#app')
There you go!
From the documentation : Getting started
- [Vuejs]-Middleman with vue-router loading 'Page Not Found' on page reload
- [Vuejs]-Why to reference the this variable to modify the DOM elements? :Clarification on 'this' in Vue Component
Source:stackexchange.com