Vue.js handler property of watch object

Viewed 257

I was wondering If there was a way that I can assign a function to the handler property of my object in Watch? currently I have all my code in the handler itself, but ideally would just like to say something like handler: this.handleChange and have handleChange be a function inside the methods property of my Vue component.

Thank you!

1 Answers

You could refactor the handler code in a separate method and call that method inside your handler like :

handler(){
  this.handleChange();
}
Related