<map @markertap='onMarkertap' :latitude='location.latitude' :longitude='location.longitude' :markers='markers' class="mapBox"></map>
const renderToMap = () => {
const list = vipListPinia.list
const arrs = []
list.forEach((v, idx) => {
console.log(idx);
arrs.push({
id: 1,
latitude: v.profile.latitude,
longitude: v.profile.longitude,
title: v.nickname,
iconPath: `/static/image/mapVip${v.vip || 3}.png`,
width: '64',
height: '64',
callout: {
content: v.nickname,
color: '#FFFFFF',
fontSize: 12,
bgColor: '#301819',
padding: 10,
borderRadius: 20,
}
})
})
markers.value = arrs
}
const onMarkertap = (e) => {
console.log(123123);
console.log(e);
const list = vipListPinia.list
firstInfo.value = list[e.detail.markerId]
}
搜索过 很多都说因为没有设置id 或者id为0导致的
但是我试过 真机上 还是没有反应
1 个回复
DCloud_UNI_WZF
测试未复现该问题,请检查代码或提供测试工程