I have a list dropdown component that accepts items
props which could be a reactive or non-reactive object/array.
So I watch
it to react when the items change. But when I provide a static non-reactive array/object it issues warning that non-reactive value is provided for watch()
. Yes, I don't care watching a non-reactive value.
How to handle watching of a reactive/non-reactive value as short as possible?
67 views Asked by Alexander Nenashev At
1
Try to use the
toValue
utility as getter for your watcher (requires vue +3.3):