浏览代码

添加链接形式跳转,路由base

asd123a20 2 年之前
父节点
当前提交
44d990bbe8
共有 3 个文件被更改,包括 6 次插入1 次删除
  1. 2 0
      src/components/heads/nav/index.vue
  2. 2 0
      src/components/leftmenu/index.vue
  3. 2 1
      src/router/index.js

+ 2 - 0
src/components/heads/nav/index.vue

@@ -63,6 +63,8 @@ export default {
         this.$router.push(`/org/${this.activeIndex}?parentCode=${parentCode}`);
         return;
       }
+      // 类型为0(链接)跳转链接
+      if (env.type == '0') window.open(env.url);
       // 类型为1(栏目)进入列表页
       if (env.type == '1') this.$router.push(`/list/${this.activeIndex}?parentCode=${parentCode}`);
       // 类型为2(单页)进入单页页面

+ 2 - 0
src/components/leftmenu/index.vue

@@ -42,6 +42,8 @@ export default {
         this.$router.push(`/constitution/${item.code}?parentCode=${parentCode}`);
         return;
       }
+      // 类型为0(链接)跳转链接
+      if (item.type == '0') window.open(item.url);
       // 类型为1(栏目)进入列表页
       if (item.type == '1') this.$router.push(`/list/${item.code}?parentCode=${parentCode}`);
       // 类型为2(单页)进入单页页面

+ 2 - 1
src/router/index.js

@@ -5,7 +5,7 @@ Vue.use(VueRouter);
 
 const routes = [
   {
-    path: '/www',
+    path: '/',
     name: 'home',
     component: () => import('../views/Home.vue')
   },
@@ -42,6 +42,7 @@ const routes = [
 ];
 
 const router = new VueRouter({
+  base: '/www/',
   mode: 'history',
   routes
 });