29 lines
570 B
JavaScript
29 lines
570 B
JavaScript
import {createApp} from 'vue'
|
|
import App from './App'
|
|
import { createRouter, createWebHistory } from "vue-router"
|
|
|
|
import Customers from './components/Customers'
|
|
import Posts from './components/Posts'
|
|
|
|
const routes = [
|
|
{
|
|
path: '/customers/:id?',
|
|
name: "Customers",
|
|
component: Customers,
|
|
props: true
|
|
},
|
|
{
|
|
path: '/posts',
|
|
name: "Posts",
|
|
component: Posts,
|
|
props: true
|
|
}
|
|
]
|
|
|
|
const router = createRouter({
|
|
routes,
|
|
history: createWebHistory()
|
|
})
|
|
|
|
|
|
createApp(App).use(router).mount('#app') |