Routing cleanup and improvement (#227)

This commit is contained in:
w1nst0n
2021-06-26 10:19:10 +00:00
committed by GitHub
parent 1dc5450223
commit 17ea593bb0
2 changed files with 13 additions and 47 deletions

View File

@@ -1,50 +1,11 @@
import { createRouter, createWebHistory } from "vue-router";
const routes = [
{
path: "/watch",
component: () => import("../components/WatchVideo.vue"),
},
{
path: "/watch/:v",
component: () => import("../components/WatchVideo.vue"),
},
{
path: "/embed/:v",
component: () => import("../components/WatchVideo.vue"),
},
{
path: "/w/:v",
component: () => import("../components/WatchVideo.vue"),
},
{
path: "/v/:v",
component: () => import("../components/WatchVideo.vue"),
},
{
path: "/shorts/:v",
component: () => import("../components/WatchVideo.vue"),
},
{
path: "/",
name: "Trending",
component: () => import("../components/TrendingPage.vue"),
},
{
path: "/channel/:channelId",
name: "ChannelId",
component: () => import("../components/Channel.vue"),
},
{
path: "/c/:channelC",
name: "ChannelC",
component: () => import("../components/Channel.vue"),
},
{
path: "/user/:channelUser",
name: "ChannelUser",
component: () => import("../components/Channel.vue"),
},
{
path: "/preferences",
name: "Preferences",
@@ -60,6 +21,14 @@ const routes = [
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"),
},
];
const router = createRouter({