D
D
Dmitry Baskakov2020-01-28 02:42:53
Vue.js
Dmitry Baskakov, 2020-01-28 02:42:53

How to trigger parent object event from vue js template?

How to trigger vue js parent object event?

It is necessary to trigger the event of the parent object in the template when entering text, but I can’t figure out how to do it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-01-28
@dmitrybascacov

In child component: In parent:
<input @input="$emit('fucking-event')">

<fucking-component @fucking-event="onFuckingEvent">

methods: {
  onFuckingEvent() {
    console.log('fuck off');
  },

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question