C
C
Comnox2021-09-02 10:55:46
Vue.js
Comnox, 2021-09-02 10:55:46

StopPropagation for checkbox not working on click?

Good afternoon, I encountered such a problem that when a checkbox is selected, @click on the parent element is triggered, i.e. when clicking on the input, it calls both the firstMethod and the secondMethod,
tried to solve the problem through the .stop modifier for the event in vue, but it didn’t help, the component itself looks like this:

<h5 @click="первыйМетод">
      <input type="checkbox"
        @click.stop
        @input="второйМетод"
      />
</h5>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Comnox, 2021-09-02
@Comnox

solved the problem via @click.self="firstMethod"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question