// directly watching a ref const selected = ref(props.selected) watch(selected, (selection, prevSelection) => { /* ... */ })