Answer the question
In order to leave comments, you need to log in
In which block should the vm.$watch('abc', function (newVal, oldVal) { construct be inserted in vue-cli?
I decided to try an alternative version of watch https://ru.vuejs.org/v2/api/#vm-watch
but I don’t understand where exactly to insert the construction (replaced vm with this - right?) I
’m constantly confused - the manual is written for this vm (why- then) - but in fact there is no vm in single-file scripts ,
plz tell me
thanks!
Answer the question
In order to leave comments, you need to log in
vm is short for view-model. It's essentially a vue instance, and inside the component, it's this.
$watch is usually placed in a component's hooks - created() or mounted() for example.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question