This commit is contained in:
lizhuang
2023-04-04 17:56:44 +08:00
parent 6a3fa25b7d
commit 46025f6011
93 changed files with 8110 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
import {
createRouter,
createWebHistory,
} from "vue-router";
// 1.定义路由组件
import IndexHome from "../views/IndexHome.vue";
import Home from "../views/index/Home.vue";
import FilmDetails from "../views/index/FilmDetails.vue";
import Play from "../views/index/Play.vue";
import SearchFilm from "../views/index/SearchFilm.vue";
import CategoryFilm from "../views/index/CategoryFilm.vue";
import NotFound from '../views/error/Error404.vue'
// 2. 定义一个路由
const routes = [
{
path: '/',
component: IndexHome,
redirect: '/index',
children: [
{path: 'index', component: Home},
{path: 'filmDetail', component: FilmDetails},
{path: 'play', component: Play},
{path: 'search', component: SearchFilm},
{path: 'CategoryFilm', component: CategoryFilm},
]
},
{path: `/:pathMatch(.*)*`, component: NotFound},
]
// 创建路由实例并传递 routes配置
const router = createRouter({
history: createWebHistory(),
routes
})
export {router}