mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +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
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
@ -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({
|
||||||
@ -37,3 +38,7 @@ 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