iid-homework/src/router/index.ts
adb-sh 42a82a2b31
All checks were successful
continuous-integration/drone/push Build is passing
add edit items
2023-01-08 17:31:58 +01:00

36 lines
734 B
TypeScript

import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import HomeView from '../views/HomeView.vue';
import ShoppingList from '../views/ShoppingList.vue';
import AddItem from '../views/AddItem.vue';
import EditItem from '../views/EditItem.vue';
const routes: Array<RouteRecordRaw> = [
{
path: "/",
name: "home",
component: HomeView,
},
{
path: "/shopping-list",
name: "shopping-list",
component: ShoppingList,
},
{
path: "/add-item",
name: "add-item",
component: AddItem,
},
{
path: "/edit-item/:id",
name: "edit-item",
component: EditItem,
},
];
const router = createRouter({
history: createWebHistory(),
routes,
});
export default router;