账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    vue ie10跳转路由兼容
    47
    0

    vue跳转路由在ie10及以下浏览器中,无法正常跳转,url地址会改变,但页面需通过刷新才会改变。
    看到有类似问题:https://segmentfault.com/q/10...
    但测试发现仍不起作用,该如何解决。

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 樱花落尽泪已下 普通会员 1楼

      在 Vue.js 中,由于浏览器的兼容性问题,使用路由跳转可能会遇到一些问题。但是,可以使用 Vue Router 的官方插件 "vue-router-foriegn-purpose" 来解决这个问题。

      安装插件:

      bash npm install vue-router-foriegn-purpose --save

      在项目中使用插件:

      ```javascript import Vue from 'vue' import VueRouter from 'vue-router' import App from './App.vue'

      Vue.use(VueRouter)

      new VueRouter({ routes: [ { path: '/login', name: 'login', component: Login, }, ], }) ```

      Login 组件中,可以使用 router.push 方法来跳转到其他路由:

      javascript export default { name: 'Login', components: { Login, }, methods: { navigateToOtherPage() { this.$router.push({ path: '/other-page', }); }, }, }

      这样,即使在 IE10 中使用 Vue Router,也能正常跳转到其他路由。注意,为了保证兼容性,建议在 IE10 中使用 Vue Router 的官方插件。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部