|
@@ -6,23 +6,18 @@
|
|
|
* keepAlive 是否缓存页面
|
|
|
* @type {*[]}
|
|
|
*/
|
|
|
+//1.创建组件
|
|
|
+import Home from '../components/Home.vue';
|
|
|
+import News from '../components/News.vue';
|
|
|
+import Content from '../components/Content.vue';
|
|
|
+import Pcontent from '../components/Pcontent.vue';
|
|
|
+
|
|
|
+//2.配置路由
|
|
|
const routers = [
|
|
|
-// {
|
|
|
-// path: '/',
|
|
|
-// redirect: '/index'
|
|
|
-// },
|
|
|
- {
|
|
|
- path: '/index',
|
|
|
- component: resolve => require(['../pages/Home/Index'], resolve),
|
|
|
- name: 'Index',
|
|
|
- meta: {
|
|
|
- navShow: false,
|
|
|
- tabShow: true,
|
|
|
- keepAlive: true
|
|
|
- }
|
|
|
- },
|
|
|
- { path: '/home', component: resolve=>rerquire(['../componets/Home.vue'],resolve) },
|
|
|
- { path: '*', redirect: '/home' } /*默认跳转路由*/
|
|
|
+ { path: '/home', component: Home },
|
|
|
+ { path: '/news', component: News },
|
|
|
+ { path: '/content/:aid', component: Content }, /*动态路由*/
|
|
|
+ { path: '/pcontent', component: Pcontent },
|
|
|
+ { path: '*', redirect: '/home' } /*默认跳转路由*/
|
|
|
]
|
|
|
-
|
|
|
export default routers
|