mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-09-04 06:09:48 +08:00
feat: 提供getHistory获取history
This commit is contained in:
parent
6e27828b9f
commit
6b7dc0324a
@ -293,7 +293,7 @@ export default function (api) {
|
|||||||
|
|
||||||
api.addCoreExports(() => [
|
api.addCoreExports(() => [
|
||||||
{
|
{
|
||||||
specifiers: ['getRoutes', 'getRouter'],
|
specifiers: ['getRoutes', 'getRouter', 'getHistory'],
|
||||||
source: absCoreFilePath
|
source: absCoreFilePath
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
@ -3,7 +3,7 @@ import { plugin } from '@@/core/coreExports';
|
|||||||
|
|
||||||
export function getRoutes() {
|
export function getRoutes() {
|
||||||
const routes = {{{ routes }}};
|
const routes = {{{ routes }}};
|
||||||
|
|
||||||
plugin.applyPlugins({
|
plugin.applyPlugins({
|
||||||
key: 'patchRoutes',
|
key: 'patchRoutes',
|
||||||
type: ApplyPluginsType.event,
|
type: ApplyPluginsType.event,
|
||||||
@ -15,14 +15,15 @@ export function getRoutes() {
|
|||||||
|
|
||||||
const ROUTER_BASE = '{{{ routerBase }}}';
|
const ROUTER_BASE = '{{{ routerBase }}}';
|
||||||
let router = null;
|
let router = null;
|
||||||
|
let history = null;
|
||||||
export const createRouter = () => {
|
export const createRouter = () => {
|
||||||
if (router) {
|
if (router) {
|
||||||
return router;
|
return router;
|
||||||
}
|
}
|
||||||
const history = {{{ CREATE_HISTORY }}}(ROUTER_BASE)
|
history = {{{ CREATE_HISTORY }}}(ROUTER_BASE)
|
||||||
router = createVueRouter({
|
router = createVueRouter({
|
||||||
history,
|
history,
|
||||||
routes: getRoutes()
|
routes: getRoutes()
|
||||||
});
|
});
|
||||||
|
|
||||||
plugin.applyPlugins({
|
plugin.applyPlugins({
|
||||||
@ -36,4 +37,8 @@ export const createRouter = () => {
|
|||||||
|
|
||||||
export const getRouter = ()=>{
|
export const getRouter = ()=>{
|
||||||
return router;
|
return router;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getHistory = ()=>{
|
||||||
|
return history;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user