mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-05-21 13:39:37 +08:00
fix: modifyHistroy改为modifyCreateHistroy,避免执行不必要的创建初始逻辑路由
This commit is contained in:
parent
e52b5232ae
commit
2097206e19
@ -296,6 +296,12 @@ export default {
|
|||||||
|
|
||||||
配置 webpack 的 publicPath。当打包的时候,webpack 会在静态文件路径前面添加 `publicPath` 的值,当你需要修改静态文件地址时,比如使用 CDN 部署,把 `publicPath` 的值设为 CDN 的值就可以。
|
配置 webpack 的 publicPath。当打包的时候,webpack 会在静态文件路径前面添加 `publicPath` 的值,当你需要修改静态文件地址时,比如使用 CDN 部署,把 `publicPath` 的值设为 CDN 的值就可以。
|
||||||
|
|
||||||
|
## router
|
||||||
|
|
||||||
|
- 类型: `object`
|
||||||
|
- 默认值: `{ mode: 'hash' }`
|
||||||
|
- 详情: 配置路由,具体请查看指南中关于路由的介绍
|
||||||
|
|
||||||
## singular
|
## singular
|
||||||
- 类型: `boolean`
|
- 类型: `boolean`
|
||||||
- 默认值: `false`
|
- 默认值: `false`
|
||||||
|
@ -28,7 +28,7 @@ export default function (api) {
|
|||||||
// 修改路由
|
// 修改路由
|
||||||
'patchRoutes',
|
'patchRoutes',
|
||||||
// 修改histror
|
// 修改histror
|
||||||
'modifyHistroy',
|
'modifyCreateHistroy',
|
||||||
// 生成router时触发
|
// 生成router时触发
|
||||||
'onRouterCreated'
|
'onRouterCreated'
|
||||||
]
|
]
|
||||||
|
@ -20,11 +20,15 @@ export const createRouter = (routes) => {
|
|||||||
if (router) {
|
if (router) {
|
||||||
return router;
|
return router;
|
||||||
}
|
}
|
||||||
history = plugin.applyPlugins({
|
const createHistory = plugin.applyPlugins({
|
||||||
key: 'modifyHistroy',
|
key: 'modifyCreateHistroy',
|
||||||
type: ApplyPluginsType.modify,
|
type: ApplyPluginsType.modify,
|
||||||
initialValue: {{{ CREATE_HISTORY }}}(ROUTER_BASE),
|
args: {
|
||||||
|
base: ROUTER_BASE
|
||||||
|
},
|
||||||
|
initialValue: {{{ CREATE_HISTORY }}},
|
||||||
});
|
});
|
||||||
|
history = createHistory(ROUTER_BASE)
|
||||||
router = createVueRouter({
|
router = createVueRouter({
|
||||||
history,
|
history,
|
||||||
routes
|
routes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user