zoukankan      html  css  js  c++  java
  • vue项目中跳转到外部链接方法

    在项目文件中,如果是vue页面中的内部跳转,用this.$router.push()可以实现,

     例如:
    this.$router.push({path: '/channeldetailview', query: {channelid: this.data.id}});

    跳到外部链接,不能用这个。不然就会报错,看一下链接的路径,原来外部链接前面加上了http://localhost:8080/#/这一串导致跳转出现问题

    那么我们如何跳转到外部链接呢,我们只需用 window.location.href = ‘url’来实现

     例如:
    window.location.href = examurl
             window.location.href = 'www.baidu.com'
  • 相关阅读:
    对白
    泰芒了
    下雨
    聚会
    周末了
    One English Sentence
    Struts拦截器使用
    JAVA语法题
    jquery全选框的实现
    实战3--设计实体, 映射实体
  • 原文地址:https://www.cnblogs.com/OIMM/p/13050605.html
Copyright © 2011-2022 走看看