2021-04-07 11:45:40 +00:00
|
|
|
import { createRouter, createWebHistory } from "vue-router";
|
2020-12-09 13:33:29 +00:00
|
|
|
|
2021-04-07 11:45:40 +00:00
|
|
|
const routes = [
|
|
|
|
{
|
|
|
|
path: "/",
|
|
|
|
name: "Trending",
|
|
|
|
component: () => import("../components/TrendingPage.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/preferences",
|
|
|
|
name: "Preferences",
|
|
|
|
component: () => import("../components/Preferences.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/results",
|
|
|
|
name: "SearchResults",
|
|
|
|
component: () => import("../components/SearchResults.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/playlist",
|
|
|
|
name: "Playlist",
|
|
|
|
component: () => import("../components/Playlist.vue"),
|
|
|
|
},
|
2021-06-26 10:19:10 +00:00
|
|
|
{
|
|
|
|
path: "/:path(v|w|embed|shorts|watch)/:v?",
|
|
|
|
component: () => import("../components/WatchVideo.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/:path(channel|user|c)/:channelId/:videos?",
|
|
|
|
component: () => import("../components/Channel.vue"),
|
|
|
|
},
|
2021-07-16 22:56:41 +00:00
|
|
|
{
|
|
|
|
path: "/login",
|
|
|
|
name: "Login",
|
|
|
|
component: () => import("../components/LoginPage.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/register",
|
|
|
|
name: "Register",
|
|
|
|
component: () => import("../components/RegisterPage.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/feed",
|
|
|
|
name: "Feed",
|
|
|
|
component: () => import("../components/FeedPage.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/import",
|
|
|
|
name: "Import",
|
|
|
|
component: () => import("../components/ImportPage.vue"),
|
|
|
|
},
|
2021-04-07 11:45:40 +00:00
|
|
|
];
|
2020-12-09 13:33:29 +00:00
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
history: createWebHistory(),
|
2021-04-07 11:45:40 +00:00
|
|
|
routes,
|
2021-07-04 19:29:19 +00:00
|
|
|
scrollBehavior: function(_to, _from, savedPosition) {
|
|
|
|
return savedPosition ? savedPosition : window.scrollTo(0, 0);
|
|
|
|
},
|
2021-04-07 11:45:40 +00:00
|
|
|
});
|
2020-12-09 13:33:29 +00:00
|
|
|
|
2021-04-07 11:45:40 +00:00
|
|
|
export default router;
|