|
@@ -1,10 +1,10 @@
|
|
-import Vue from 'vue'
|
|
|
|
-import Router from 'vue-router'
|
|
|
|
|
|
+import Vue from "vue";
|
|
|
|
+import Router from "vue-router";
|
|
|
|
|
|
-Vue.use(Router)
|
|
|
|
|
|
+Vue.use(Router);
|
|
|
|
|
|
/* Layout */
|
|
/* Layout */
|
|
-import Layout from '@/layout'
|
|
|
|
|
|
+import Layout from "@/layout";
|
|
|
|
|
|
/**
|
|
/**
|
|
* Note: sub-menu only appear when route children.length >= 1
|
|
* Note: sub-menu only appear when route children.length >= 1
|
|
@@ -32,33 +32,46 @@ import Layout from '@/layout'
|
|
*/
|
|
*/
|
|
export const constantRoutes = [
|
|
export const constantRoutes = [
|
|
{
|
|
{
|
|
- path: '/login',
|
|
|
|
- component: () => import('@/views/login/index'),
|
|
|
|
- hidden: true
|
|
|
|
|
|
+ path: "/login",
|
|
|
|
+ component: () => import("@/views/login/index"),
|
|
|
|
+ hidden: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: '/external/open_engin',
|
|
|
|
- name: 'open_engin',
|
|
|
|
- component: () => import('@/views/external/open_engin'),
|
|
|
|
- hidden: true
|
|
|
|
|
|
+ path: "/external/open_engin",
|
|
|
|
+ name: "open_engin",
|
|
|
|
+ component: () => import("@/views/external/open_engin"),
|
|
|
|
+ hidden: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- path: '/404',
|
|
|
|
- component: () => import('@/views/404'),
|
|
|
|
- hidden: true
|
|
|
|
|
|
+ path: "/404",
|
|
|
|
+ component: () => import("@/views/404"),
|
|
|
|
+ hidden: true,
|
|
},
|
|
},
|
|
|
|
|
|
- // {
|
|
|
|
- // path: '/',
|
|
|
|
- // component: Layout,
|
|
|
|
- // redirect: '/dashboard',
|
|
|
|
- // children: [{
|
|
|
|
- // path: 'dashboard',
|
|
|
|
- // name: 'Dashboard',
|
|
|
|
- // component: () => import('@/views/dashboard/index'),
|
|
|
|
- // meta: { title: '首页', icon: 'dashboard'}
|
|
|
|
- // }]
|
|
|
|
- // },
|
|
|
|
|
|
+ {
|
|
|
|
+ path: "/supply",
|
|
|
|
+ component: Layout,
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ path: "deliver/new_apply",
|
|
|
|
+ name: "new_apply",
|
|
|
|
+ component: () => import("@/views/supply/apply/new_apply"),
|
|
|
|
+ meta: { title: "零售退货申请", icon: "" },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ path: "/supply",
|
|
|
|
+ component: Layout,
|
|
|
|
+ children: [
|
|
|
|
+ {
|
|
|
|
+ path: "deliver/new_engin",
|
|
|
|
+ name: "new_apply",
|
|
|
|
+ component: () => import("@/views/supply/apply/new_engin"),
|
|
|
|
+ meta: { title: "工程退货申请", icon: "" },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
// {
|
|
// {
|
|
// path: '/goods',
|
|
// path: '/goods',
|
|
// component: Layout,
|
|
// component: Layout,
|
|
@@ -265,27 +278,23 @@ export const constantRoutes = [
|
|
// ]
|
|
// ]
|
|
// },
|
|
// },
|
|
|
|
|
|
-
|
|
|
|
// 404 page must be placed at the end !!!
|
|
// 404 page must be placed at the end !!!
|
|
// { path: '*', redirect: '/404', hidden: true }
|
|
// { path: '*', redirect: '/404', hidden: true }
|
|
-]
|
|
|
|
-
|
|
|
|
|
|
+];
|
|
|
|
|
|
|
|
+const createRouter = () =>
|
|
|
|
+ new Router({
|
|
|
|
+ // mode: 'history', // require service support
|
|
|
|
+ scrollBehavior: () => ({ y: 0 }),
|
|
|
|
+ routes: constantRoutes,
|
|
|
|
+ });
|
|
|
|
|
|
-const createRouter = () => new Router({
|
|
|
|
- // mode: 'history', // require service support
|
|
|
|
- scrollBehavior: () => ({ y: 0 }),
|
|
|
|
- routes: constantRoutes
|
|
|
|
-})
|
|
|
|
-
|
|
|
|
-const router = createRouter()
|
|
|
|
|
|
+const router = createRouter();
|
|
|
|
|
|
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
|
|
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
|
|
export function resetRouter() {
|
|
export function resetRouter() {
|
|
- const newRouter = createRouter()
|
|
|
|
- router.matcher = newRouter.matcher // reset router
|
|
|
|
|
|
+ const newRouter = createRouter();
|
|
|
|
+ router.matcher = newRouter.matcher; // reset router
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-export default router
|
|
|
|
|
|
+export default router;
|