window.open:打开新窗口
跨项目传参:
let token = Cookies.get('token')
window.open("http://xxx.xxx.x.xxx:8001/#/login", token)
跨项目接参:
console.log(window.name);
传参:
download(item) {
window.open('http://localhost:xxxx/#/xxxx/newbaseDownload?id=' + item.id)
}
接参:
created() {
console.log(this.$route,"this.$route");
console.log(this.$route.query, "参数id")
console.log(this.$route.query.id)
},
window.location.href:旧窗口
传参:通过地址栏传参
var source = "wed"
window.location.href = 'http://xxx.xxx.x.xxx:8001/#/login?source=' + source
接参:
let sourceurl = window.location.href
let sourcetxt = sourceurl.split("=")
sourcetxt = decodeURI(sourcetxt[1])