R
R
RomanKudlatov2021-06-20 23:26:18
Vue.js
RomanKudlatov, 2021-06-20 23:26:18

How to add eventListener dynamically in vue?

When using vue and hanging on some eventListener selectors when the page loads, if v-if is used, then when the element is hidden, the eventListener is removed. I realized that it can be solved using v-show, but now I think is it possible to use v-if and so that the deletion does not happen?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2021-06-21
@Fragster

What's wrong with native vue handlers? https://ru.vuejs.org/v2/api/#v-on

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question