C
C
colorkid2017-04-30 23:31:54
JavaScript
colorkid, 2017-04-30 23:31:54

How to call a function on a component every time an input parameter changes in VUE JS?

Hello. There was such question it is impossible to find the answer to it. There is a code https://jsfiddle.net/zoufgbc8/
there is a buttons component. It is necessary that when changing the values ​​in DATA in the parent, a function was called in this component (child). How to implement this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
wostex, 2017-05-01
@colorkid

in the watch component: { propName: function() { ... this code is executed when the propName value changes}}

E
Evgeny Kulakov, 2017-05-01
@kulakoff Vue.js

In your case, it may not be necessary: ​​https://jsfiddle.net/kulakoff/9u3yzfLs/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question