Vue on the route -ie address bar does not update the routing page

Scenario: Type in the address bar on ie11 direct route, normal development environment refresh the page is not updated is not error on the test environment. Enter the test environment directly on the route Firefox, chrome browser address bar can properly update the page. But after adding the following code in App.vue, the test environment can be normal in ie11 update page. 
Much gossip that the codes:
const = {IE11RouterFix
Methods: {
hashChangeHandler:. Function () {$ router.push the this (window.location.hash.substring (. 1, window.location.hash.length))},
isIE11 : function () {return !! window.MSInputMethodContext document.documentMode && !!}
},
Mounted: function () {IF (this.isIE11 ()) {window.addEventListener ( 'hashchange', this.hashChangeHandler)}},
Destroyed: function () {IF (this.isIE11 ()) {window.removeEventListener ( 'hashchange', this.hashChangeHandler)}}
}

new Vue({
el: '#app',
router,
store,
render: h => h(App),
mixins: [IE11RouterFix]
})

Guess you like

Origin www.cnblogs.com/hanzeng1993/p/12106175.html