Router mode history, and all routes got names.

This commit is contained in:
2020-10-11 13:53:08 +02:00
committed by KevinMidboe
parent 4ce8ca1a99
commit 9d9947d7dc

View File

@@ -1,3 +1,5 @@
import VueRouter from "vue-router";
import VinlottisPage from "@/components/VinlottisPage"; import VinlottisPage from "@/components/VinlottisPage";
import GeneratePage from "@/components/GeneratePage"; import GeneratePage from "@/components/GeneratePage";
import TodaysPage from "@/components/TodaysPage"; import TodaysPage from "@/components/TodaysPage";
@@ -19,30 +21,37 @@ import AllRequestedWines from "@/components/AllRequestedWines";
const routes = [ const routes = [
{ {
path: "*", path: "*",
name: "Hjem",
component: VinlottisPage component: VinlottisPage
}, },
{ {
path: "/lottery", path: "/lottery",
name: "Lotteri",
component: LotteryPage component: LotteryPage
}, },
{ {
path: "/dagens", path: "/dagens",
name: "Dagens vin",
component: TodaysPage component: TodaysPage
}, },
{ {
path: "/viner", path: "/viner",
name: "Alle viner",
component: AllWinesPage component: AllWinesPage
}, },
{ {
path: "/login", path: "/login",
name: "Login",
component: LoginPage component: LoginPage
}, },
{ {
path: "/create", path: "/create",
name: "Registrer",
component: CreatePage component: CreatePage
}, },
{ {
path: "/admin", path: "/admin",
name: "Admin",
component: AdminPage component: AdminPage
}, },
{ {
@@ -54,21 +63,40 @@ const routes = [
component: WinnerPage component: WinnerPage
}, },
{ {
path: "/history", path: "/history/:date",
name: "Historie for dato",
component: HistoryPage component: HistoryPage
}, },
{
path: "/history/",
name: "Historie",
component: HistoryPage
},
{
path: "/highscore/:name",
name: "Personlig toppliste",
component: PersonalHighscorePage
},
{ {
path: "/highscore", path: "/highscore",
name: "Topplisten",
component: HighscorePage component: HighscorePage
}, },
{ {
path: "/request", path: "/request",
name: "Etterspør vin",
component: RequestWine component: RequestWine
}, },
{ {
path: "/requested-wines", path: "/requested-wines",
name: "Etterspurte viner",
component: AllRequestedWines component: AllRequestedWines
} }
]; ];
export { routes }; const router = new VueRouter({
routes: routes,
mode: "history"
});
export default router;