D
D
danilr2019-04-25 07:45:58
Vue.js
danilr, 2019-04-25 07:45:58

How to call a method when the prop changes?

There is a method that should be called when one of the props values ​​changes. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Khokhlov, 2019-04-25
@danilr

watch
https://ru.vuejs.org/v2/api/#watch

watch: {
  propName() {
    callMethod();
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question