0
data: {
return {
modelPotion: {
left: 0,
top: 0,
}
activeModelIndex: false,
curItem: ''
}
}
<li>
<span>通过</span>
<span @click="handleRefuse($event,item)">拒绝</span>
</li>
// 一个就够了
<Modal v-if="activeModelIndex" :item="curItem" :style="{ left: `${modelPotion.left}px`,top: `${modelPotion.top}px`}">
handleRefuse(event,item){
console.log(event) //可以拿到当前坐标
this.modelPotion = {
left: event.x
top: event.y
}
this.activeModelIndex = true
this.curItem = item
}