I’m working on a small project, and I would like to know how can i watch my search key
this is my code :
data:() => ({ form: { search: '', } }), watch: { // how can i watch search }
Advertisement
Answer
data: () => ({ form: { search: '', } }), watch: { 'form.search': (new, old) => { // do something } }
full example on vue doc