[TOC]
创建 src/views/course-info/index.vue // views/course-info/index.vue 设置路由规则 // router/index.js { path: ‘/course-info/:courseId/‘, name: ‘course-info’, component: () => import(/ webpackChunkName: ‘course-info’ / ‘@/views/course/info’), props: true }, 设置跳转 // course/components/CourseContentList.vue v-for=“item in list” @click=“$router.push({ name: ‘course-info’, params: { courseId: item.id } })” > 在组件中通过 props 接收路径传参 // course-info/index.vue props: { courseId: { type: [String, Number], required: true } },