Skip to content

Commit 415c2b9

Browse files
committed
Add vue-router workaround for IE11 bug...
vuejs/vue-router#1911
1 parent 58d545b commit 415c2b9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

resources/assets/js/app.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66

77
require('./bootstrap');
8-
import 'babel-polyfill';
98
import axios from 'axios';
9+
import 'babel-polyfill';
1010
import BootstrapVue from 'bootstrap-vue';
1111
import VCalendar from 'v-calendar';
1212
import 'v-calendar/lib/v-calendar.min.css';
@@ -49,6 +49,16 @@ const router = new VueRouter({
4949
],
5050
});
5151

52+
// https://github.com/vuejs/vue-router/issues/1849#issuecomment-340767577
53+
if ('-ms-scroll-limit' in document.documentElement.style && '-ms-ime-align' in document.documentElement.style) { // detect it's IE11
54+
window.addEventListener("hashchange", function (event) {
55+
var currentPath = window.location.hash.slice(1);
56+
if (router.currentRoute.path !== currentPath) {
57+
router.push(currentPath);
58+
}
59+
}, false);
60+
}
61+
5262
axios.defaults.headers.common.Accept = 'application/json';
5363

5464
/**

0 commit comments

Comments
 (0)