<template>
let infoWindow = new AMap.InfoWindow({
offset: new AMap.Pixel(20, 30),
content:`<div class="InfoWindow">
<div class="btn" onclick="window.bigData.lookDetail(${InfoWindowDetail.id})">查看详情</div>
</div>`//信息窗体的内容
});
infoWindow.open(this.map,marker.getPosition());
</template>
method:{
lookDetail(val){
let routeUrl= this.$router.resolve({
name: 'premisesEdit',
params:{//不同的物体靠id来判断跳转的详情
id: val
}
})
window.open(routeUrl.href, '_blank');
},
},
mounted(){
window.bigData = this;
}
vue router 在地图的信息窗口 点击后新窗口跳转
最新推荐文章于 2024-04-29 07:18:02 发布