vuejs / Discussion

Vue.js discussion
167 stars 17 forks source link

Triggering a method after the change of the props of a component #377

Closed kenyiu closed 9 years ago

kenyiu commented 9 years ago

Hello, I would like to trigger a method after the change of the props of a component, instead of passing a callback, anyway if i can make it under the component? I have looked through the lifecycle of a componenet on doc, but seems nothing Thanks

azamat-sharapov commented 9 years ago

Maybe vm.$watch() can help? You can find it on API docs

kenyiu commented 9 years ago

@azamat-sharapov thanks for the keyword! Found this fit my case:http://vuejs.org/api/options.html#watch