问题:
使用vue-router 在IE下 a标签里的路由不跳转,火狐,chrome工作正常。
解决:
在App.vue 里增加判断IE浏览器手动修复……
export default { name: 'App', mounted(){ function checkIE(){ return '-ms-scroll-limit' in document.documentElement.style && '-ms-ime-align' in document.documentElement.style } if (checkIE()) { window.addEventListener('hashchange', () => { var currentPath = window.location.hash.slice(1); if (this.$route.path !== currentPath) { this.$router.push(currentPath) } }, false) } } }
参考:
github大佬
版权声明:本文为lllo3o原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。