D
D
devilsD2018-07-10 14:07:51
JavaScript
devilsD, 2018-07-10 14:07:51

How to add an @click handler to a Vue component?

There is a single-file component. You need to hang the following handler on it:
<btn-default>Заказать</btn-default>

<btn-default @click="showModal = true">Заказать</btn-default>

But for some reason it doesn't work. If you set a handler for any tag, does the event fire?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alex, 2018-07-10
@devilsD

<btn-default @click.native="showModal = true">Заказать</btn-default>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question