Skip to content

Commit

Permalink
feat: patchRoutes延后,放在createRouter之前执行
Browse files Browse the repository at this point in the history
  • Loading branch information
wanchun committed Jun 25, 2021
1 parent ac0e7b4 commit b4fe951
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.0",
"version": "independent",
"changelog": {
"repo": "WeBankFinTech/fes.js",
"cacheDir": ".changelog",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ import { plugin } from '@@/core/coreExports';

export function getRoutes() {
const routes = {{{ routes }}};

plugin.applyPlugins({
key: 'patchRoutes',
type: ApplyPluginsType.event,
args: { routes },
});

return routes;
}

Expand All @@ -28,7 +21,13 @@ export const createRouter = (routes) => {
},
initialValue: {{{ CREATE_HISTORY }}},
});
history = createHistory(ROUTER_BASE)
history = createHistory(ROUTER_BASE);
// 修改routes
plugin.applyPlugins({
key: 'patchRoutes',
type: ApplyPluginsType.event,
args: { routes },
});
router = createVueRouter({
history,
routes
Expand Down

0 comments on commit b4fe951

Please sign in to comment.