2021-04-07 17:15:40 +05:30
|
|
|
import { createRouter, createWebHistory } from "vue-router";
|
2020-12-09 19:03:29 +05:30
|
|
|
|
2021-04-07 17:15:40 +05:30
|
|
|
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 15:49:10 +05:30
|
|
|
{
|
|
|
|
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-04-07 17:15:40 +05:30
|
|
|
];
|
2020-12-09 19:03:29 +05:30
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
history: createWebHistory(),
|
2021-04-07 17:15:40 +05:30
|
|
|
routes,
|
2021-07-05 00:59:19 +05:30
|
|
|
scrollBehavior: function(_to, _from, savedPosition) {
|
|
|
|
return savedPosition ? savedPosition : window.scrollTo(0, 0);
|
|
|
|
},
|
2021-04-07 17:15:40 +05:30
|
|
|
});
|
2020-12-09 19:03:29 +05:30
|
|
|
|
2021-04-07 17:15:40 +05:30
|
|
|
export default router;
|