فهرست منبع

拆分出自己的router文件

lxf 2 سال پیش
والد
کامیت
c8d1a4bc90
2فایلهای تغییر یافته به همراه24 افزوده شده و 16 حذف شده
  1. 4 16
      src/router/index.js
  2. 20 0
      src/router/routerLXF.js

+ 4 - 16
src/router/index.js

@@ -4,6 +4,8 @@ import {
 } from 'vue-router'
 import login from '../views/login.vue'
 import main from '../views/main.vue'
+import { routesLXF } from './routerLXF.js'
+
 const routes = [{
 		path: '/',
 		name: 'login',
@@ -207,26 +209,12 @@ const routes = [{
 				name: '完工入库新增',
 				component: () => import('../views/MES/produceManage/completeProject/add.vue')
 			},
-			{
-				path: 'materialClassification',
-				name: '物料分类',
-				component: () => import('../views/product-material/material-classification/index.vue')
-			},
-			{
-				path: 'materialClassificationAdd',
-				name: '物料添加',
-				component: () => import('../views/product-material/material-classification/add.vue')
-			},
-			{
-				path: 'materialClassificationEdit',
-				name: '物料编辑',
-				component: () => import('../views/product-material/material-classification/edit.vue')
-			},
 		]
 	},
-
 ]
 
+routes[2].children = routes[2].children.concat(routesLXF())
+
 const router = createRouter({
 	history: createWebHashHistory(),
 	routes

+ 20 - 0
src/router/routerLXF.js

@@ -0,0 +1,20 @@
+export function routesLXF() {
+  const routesLXF = [
+    {
+      path: "materialClassification",
+      name: "物料分类",
+      component: () => import("../views/product-material/material-classification/index.vue"),
+    },
+    {
+      path: "materialClassificationAdd",
+      name: "物料添加",
+      component: () => import("../views/product-material/material-classification/add.vue"),
+    },
+    {
+      path: "materialClassificationEdit",
+      name: "物料编辑",
+      component: () => import("../views/product-material/material-classification/edit.vue"),
+    },
+  ];
+  return routesLXF;
+}