V
V
Valery V.2020-01-27 16:52:16
Vue.js
Valery V., 2020-01-27 16:52:16

How to write event name in v-on subscriber: as an expression?

<component v-on:prefix-custom-event="handler"></component>

How to correctly write a subscriber for a dynamically generated event name, for example, instead of prefix there will be , etc.? I know that somehow it is possible to write in the object form, for example: but I don’t know the form of the record itself. 'red', 'green', 'blue'
<component v-on ="{тут какой то код}"></component>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-01-27
@OlegOleg1980

v-on="{ [здесь собираете имя события]: handler }"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question