点击图片拿到x,y值
template中
<image x="0" y="0" width="100%" height="100%" xlink:href="../../assets/images/background/bg_nav.png" @click="tapMap($event)" />
js中
tapMap(e) { // console.log(e); const self = this self.popStatus = false if (self.tapStatus) { let obj = { //x坐标 x: String(((e.clientX - self.domOffset.left) / self.domOffset.width) * 100).substring(0, 8) + '%', //y坐标 y: String(((e.clientY - self.domOffset.top) / self.domOffset.height) * 100).substring(0, 8) + '%', r: 8 }; // console.log(obj) //self.openDrawer(obj) } },