I am using Vue and I need to know which element was clicked as 1 is an i and the other is a button so I can pass a variable to a modal which is the same one for both as I am sharing the model but depending on which one was clicked depends on which text is displayed.
The easy (but wrong/long way) is to just have 2 click methods and pass the variable but I'd rather do it in 1 method call instead so I am no duplicating code but every time I get undefined back.
Current code
<i id="a" name="editAddress" class="fas fa-pencil-alt fa-lg px-4" v-tooltip:bottom="'Edit this address'" @click="editAddress"></i>
editAddress(e) {
let curTarget = e.currentTarget;
let acurTarget = e.currentTarget.id;
let bcurTarget = e.currentTarget.name;
console.log(curTarget)
console.log(acurTarget)
console.log(bcurTarget)
Tried code
<i id="a" name="editAddress" class="fas fa-pencil-alt fa-lg px-4" v-tooltip:bottom="'Edit this address'" type="submit" @click="handleClick($event)"></i>
<button id="addAddress" name="addAddress" class="btn btn-primary" @click.prevent="addAddress">Add a new address</button>
handleClick(e) {
console.log('TARGET', e.target);
console.log('NAME', e.target.name);
},
I can't figure out where I'm going wrong. I have also tried replacing currentTarget with target but still didn't work

