1

How do I remove the v-on:click event from a div when I click on it.

<div id="five" v-on:click="setIcon"></div>

I want the setIcon click event to be removed immediately I click on this element. I have several other elements that I want to behave this way.

1 Answer 1

3

Use the .once event modifier.

<div id="five" v-on:click.once="setIcon"></div>
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.