美文网首页
组件内手动跳转打开新窗口

组件内手动跳转打开新窗口

作者: 徐徐xue | 来源:发表于2018-02-06 12:53 被阅读0次
lookArticle(id){
        this.$store.dispatch('setNoticeId',id)
        let el = document.createElement("a");
        document.body.appendChild(el);
        el.href = "/about/news"; //url 是你得到的连接
        el.target = '_blank'; //指定在新窗口打开
        el.click();
        document.body.removeChild(el);
    }

相关文章

网友评论

      本文标题:组件内手动跳转打开新窗口

      本文链接:https://www.haomeiwen.com/subject/mdlgzxtx.html