Use Quotes to Watch Nested Values

You may not have known this, but you can easily watch nested values directly, just by using quotes:

watch: {
'$route.query.id'() {
// ...
}
}

This is really useful for working with deeply nested objects!

Get my FREE book on Vue 3!

Vue 3 Book