Skip to content

Commit 53f49df

Browse files
committed
fixed #16
1 parent 62d3f05 commit 53f49df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export default {
187187
})
188188

189189
//to和form的路由相同时,不会触发beforeEach,此时监听浏览器onpopstate事件进行补偿
190-
window.onpopstate = (e) => {
190+
window.addEventListener("popstate", function () {
191191
//如果路由处理过,则不再执行
192192
if (_routeActived) {
193193
_routeActived = false;
@@ -209,7 +209,7 @@ export default {
209209
_history.beforeState = history.state;
210210
localStorage.Save()
211211

212-
}
212+
});
213213
}
214214
})
215215
}

0 commit comments

Comments
 (0)