From 5ef550160c57d6aa524128fb0986b0d80d5f89ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E4=BA=8C=E7=8C=9B?= Date: Fri, 6 Dec 2019 14:28:09 +0800 Subject: [PATCH] F web fix bug --- spug_web/src/libs/router.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spug_web/src/libs/router.js b/spug_web/src/libs/router.js index 3aaa757..ecaf2a7 100644 --- a/spug_web/src/libs/router.js +++ b/spug_web/src/libs/router.js @@ -6,7 +6,7 @@ import styles from './libs.module.css'; // 创建单个路由 export function makeRoute(path, component) { - return {path, component} + return {subPath: path, component} } // 创建模块路由 @@ -40,7 +40,7 @@ export class Router extends React.Component { initialRoutes() { for (let moduleRoute of moduleRoutes) { for (let route of moduleRoute['routes']) { - route['fullPath'] = moduleRoute['prefix'] + route['path']; + route['path'] = moduleRoute['prefix'] + route['subPath']; this.routes.push(route) } } @@ -49,7 +49,7 @@ export class Router extends React.Component { render() { return ( - {this.routes.map(route => )} + {this.routes.map(route => )} )