Well you can register watchers on the fly, by using this.$watch(...) in Vue 2, or by importing the watch helper in Vue 3.
In the Vue 2 case, calling this.$watch(...) will return a deregistration callback that you should manually save and call when you unmount or destroy the component.
But I think it is easier to just ignore inputs from an "uninitialized" watcher, for example using the object notation which works for both Vue 2 and 3:
<template>
<!-- ... -->
</template>
<script>
export default {
data() {
// where city depends on province, and province on country
return {
country: null,
province: null,
city: null,
};
},
watch: {
country(newValue) {
if (!newValue) {
this.state = null;
this.city = null;
return;
}
// load states from this country
},
state(newValue) {
if (!newValue) {
this.city = null;
return;
}
// load cities from this country
},
city(newValue) {
if (!newValue) {
return;
}
// do something with city
},
},
};
</script>