The a tag in the js splicing string with parameters jumps and receives
第一个页面
let details = JSON.stringify(v)
let inner = `
设备名称:<a href='../#/bkqy/resultQuery?routerDetal=${details}' >${v.equipmentName || ''}</a>
<p>站点名称:${v.siteName || ''}</p>
<p>采集参数:${v.attributeName || ''}</p>
<p>设备状态:<span style="color: #30DA74">正常</span></p>
<p>地址:${v.address || ''}</p>
`
第二个页面接收
if (window.location.href.split("?")[1]) {
let C1=window.location.href.split("?")[1]; //得到routerDetal=值
let C2=C1.split("=")[1]; //得到routerDetal的值
let C3=decodeURIComponent(C2); //得到routerDetal的值
this.urlDetail=JSON.parse(C3); // 转对象
console.log(this.urlDetail)
if (window.history){
// 支持History API
history.replaceState(null,"",'/#/bkqy/resultQuery') // 不更新页面替换页面url的参数
}
}
`