diff --git a/src/layout/index.vue b/src/layout/index.vue
index d867d608..19d1dff9 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -326,7 +326,6 @@ header {
.el-menu {
border-right: 0;
padding-top: $g-breadcrumb-height;
- padding-bottom: 30px;
&:not(.el-menu--collapse) {
width: inherit;
}
diff --git a/src/router/index.js b/src/router/index.js
index 4fce2c44..c77b2dc5 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -72,6 +72,7 @@ import BreadcrumbExample from './modules/breadcrumb.example'
import KeepAliveExample from './modules/keep.alive.example'
import ComponentExample from './modules/component.example'
import PermissionExample from './modules/permission.example'
+import VideosExample from './modules/videos.example'
import ExTernalLinkExample from './modules/external.link.example'
// 当 children 不为空的主导航只有一项时,则隐藏
@@ -89,6 +90,15 @@ let asyncRoutes = [
PermissionExample
]
},
+ {
+ meta: {
+ title: '教程',
+ icon: 'sidebar-videos'
+ },
+ children: [
+ ...VideosExample
+ ]
+ },
{
meta: {
title: '其它',
diff --git a/src/router/modules/videos.example.js b/src/router/modules/videos.example.js
new file mode 100644
index 00000000..12faa59e
--- /dev/null
+++ b/src/router/modules/videos.example.js
@@ -0,0 +1,109 @@
+import Layout from '@/layout'
+
+export default [
+ {
+ path: '/videos_example/1',
+ component: Layout,
+ name: 'videosExample1',
+ meta: {
+ title: '01 - 开发环境配置'
+ },
+ children: [
+ {
+ path: '',
+ name: 'videosExampleVideo1',
+ component: () => import(/* webpackChunkName: 'videos_example' */ '@/views/videos_example/1'),
+ meta: {
+ title: '01 - 开发环境配置',
+ sidebar: false,
+ breadcrumb: false,
+ activeMenu: '/videos_example/1'
+ }
+ }
+ ]
+ },
+ {
+ path: '/videos_example/2',
+ component: Layout,
+ name: 'videosExample2',
+ meta: {
+ title: '02 - 框架配置'
+ },
+ children: [
+ {
+ path: '',
+ name: 'videosExampleVideo2',
+ component: () => import(/* webpackChunkName: 'videos_example' */ '@/views/videos_example/2'),
+ meta: {
+ title: '02 框架配置',
+ sidebar: false,
+ breadcrumb: false,
+ activeMenu: '/videos_example/2'
+ }
+ }
+ ]
+ },
+ {
+ path: '/videos_example/3',
+ component: Layout,
+ name: 'videosExample3',
+ meta: {
+ title: '03 - 布局和主题'
+ },
+ children: [
+ {
+ path: '',
+ name: 'videosExampleVideo3',
+ component: () => import(/* webpackChunkName: 'videos_example' */ '@/views/videos_example/3'),
+ meta: {
+ title: '03 布局和主题',
+ sidebar: false,
+ breadcrumb: false,
+ activeMenu: '/videos_example/3'
+ }
+ }
+ ]
+ },
+ {
+ path: '/videos_example/4',
+ component: Layout,
+ name: 'videosExample4',
+ meta: {
+ title: '04 - 全局资源'
+ },
+ children: [
+ {
+ path: '',
+ name: 'videosExampleVideo4',
+ component: () => import(/* webpackChunkName: 'videos_example' */ '@/views/videos_example/4'),
+ meta: {
+ title: '04 全局资源',
+ sidebar: false,
+ breadcrumb: false,
+ activeMenu: '/videos_example/4'
+ }
+ }
+ ]
+ },
+ {
+ path: '/videos_example/5',
+ component: Layout,
+ name: 'videosExample5',
+ meta: {
+ title: '05 - 组件'
+ },
+ children: [
+ {
+ path: '',
+ name: 'videosExampleVideo5',
+ component: () => import(/* webpackChunkName: 'videos_example' */ '@/views/videos_example/5'),
+ meta: {
+ title: '05 组件',
+ sidebar: false,
+ breadcrumb: false,
+ activeMenu: '/videos_example/5'
+ }
+ }
+ ]
+ }
+]
diff --git a/src/store/modules/global.js b/src/store/modules/global.js
index ace5b197..aaaf719e 100644
--- a/src/store/modules/global.js
+++ b/src/store/modules/global.js
@@ -129,7 +129,7 @@ const mutations = {
},
setHeaderActive(state, currentPath) {
state.allRoutes.map((item, index) => {
- if (item.children.some(r => currentPath.indexOf(r.path + '/') === 0)) {
+ if (item.children.some(r => currentPath.indexOf(r.path + '/') === 0 || currentPath == r.path)) {
state.headerNavActive = index
}
})
diff --git a/src/views/videos_example/1.vue b/src/views/videos_example/1.vue
new file mode 100644
index 00000000..cfb09447
--- /dev/null
+++ b/src/views/videos_example/1.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/videos_example/2.vue b/src/views/videos_example/2.vue
new file mode 100644
index 00000000..244d598e
--- /dev/null
+++ b/src/views/videos_example/2.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/videos_example/3.vue b/src/views/videos_example/3.vue
new file mode 100644
index 00000000..4dd0e6d6
--- /dev/null
+++ b/src/views/videos_example/3.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/videos_example/4.vue b/src/views/videos_example/4.vue
new file mode 100644
index 00000000..c71a62b5
--- /dev/null
+++ b/src/views/videos_example/4.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/videos_example/5.vue b/src/views/videos_example/5.vue
new file mode 100644
index 00000000..15ee6e4d
--- /dev/null
+++ b/src/views/videos_example/5.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+