did you get something here?
This error came up because $v is a computed prop defined during beforeCreate handler.
When you declare your component watch try to get value of $v, but at this time this is not defined and you have this Type error.
What you can do it's to call $watch inside the created handler.
new Vue({
...
created(){
this.$watch('$v', () => {
console.log('$v changed')
})
},
validations: {
...
}
})
@thibremy: Was pulling my hair out all afternoon because of this. Thanks for your solution! 馃榾
Hi, sorry for not comenting on that earlier. The original code should now just work as expected on v0.5.0. Fixed :)
Most helpful comment
This error came up because
$vis a computed prop defined duringbeforeCreatehandler.When you declare your component
watchtry to get value of$v, but at this timethisis not defined and you have thisType error.What you can do it's to call
$watchinside thecreatedhandler.