1

I have a list of tabs set up with the following markup:

<li v-on:click.stop="changeTab()" id="bookings">
    <i class="fa fa-scissors" aria-hidden="true"></i> <span>Bookings</span>
</li>

The changeTab() method is:

changeTab: function() {
    window.location.hash = this.activeTab = event.srcElement.id;
}

The issue here is that if I click on the inner elements, i / span, then it sets the incorrect ID (none) and its the srcElement. Is there a way to now allow this to happen? Can I make the wrapper the only click that is listened to?

1 Answer 1

2

use event.currentTarget.id instead of event.srcElement.id

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.