mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-01-06 01:20:27 +05:30
0992e1e96d
* WIP login and subscriptions. * Add a working feed and unsubscribe button. * Allow importing subscriptions from Google Takeout, NewPipe and Invidious.
63 lines
1.6 KiB
JavaScript
63 lines
1.6 KiB
JavaScript
import { createRouter, createWebHistory } from "vue-router";
|
|
|
|
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"),
|
|
},
|
|
{
|
|
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"),
|
|
},
|
|
{
|
|
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"),
|
|
},
|
|
];
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(),
|
|
routes,
|
|
scrollBehavior: function(_to, _from, savedPosition) {
|
|
return savedPosition ? savedPosition : window.scrollTo(0, 0);
|
|
},
|
|
});
|
|
|
|
export default router;
|