mirror of https://github.com/alibaba/ice.git
fix: custom history (#3999)
This commit is contained in:
parent
d2675e70fc
commit
31f8c5b686
|
|
@ -81,7 +81,7 @@ runApp(appConfig);
|
|||
- basename: 路由基准地址
|
||||
- fallback: 开启按需加载时配置 fallback UI
|
||||
- modifyRoutes: 动态修改路由
|
||||
- history: 自定义创建 history 对象,[详见](https://github.com/ReactTraining/history/blob/master/docs/GettingStarted.md)
|
||||
- history: 自定义创建 history 对象,[详见](https://github.com/ReactTraining/history/blob/master/docs/getting-started.md)
|
||||
|
||||
## 路由组件参数
|
||||
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ export default ({ loadRuntimeModules, createElement, initHistory = true }) => {
|
|||
let history = {};
|
||||
if (!isMiniAppPlatform && initHistory) {
|
||||
const { router } = appConfig;
|
||||
const { type, basename } = router;
|
||||
const { type, basename, history: customHistory } = router;
|
||||
const location = context.initialContext ? context.initialContext.location : null;
|
||||
history = createHistory({ type, basename, location });
|
||||
history = createHistory({ type, basename, location, customHistory });
|
||||
appConfig.router.history = history;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue