|
|
@@ -32,7 +32,7 @@ export default new (class {
|
|
|
* @param options
|
|
|
* @returns
|
|
|
*/
|
|
|
- create(options: RouterOptions) {
|
|
|
+ create = (options: RouterOptions) => {
|
|
|
const router = createRouter(options);
|
|
|
const { push, replace, go, forward, back } = router;
|
|
|
const { actionName } = toRefs(this._state.value);
|
|
|
@@ -73,7 +73,7 @@ export default new (class {
|
|
|
}
|
|
|
|
|
|
router.beforeResolve((to) => {
|
|
|
- this.add(to);
|
|
|
+ this.addHistory(to);
|
|
|
})
|
|
|
|
|
|
return router;
|
|
|
@@ -83,7 +83,7 @@ export default new (class {
|
|
|
* 添加历史记录
|
|
|
* @param route
|
|
|
*/
|
|
|
- private add(route: RouteLocationNormalized) {
|
|
|
+ private addHistory = (route: RouteLocationNormalized) => {
|
|
|
const { historyStacks, excludeName, actionName, transitionName } = toRefs(this._state.value);
|
|
|
excludeName.value = [];
|
|
|
|