3👍
✅
-
When watching a
ref
, use theref
itself — not itsvalue
property — as the watch source (the 1st argument towatch()
). -
To observe new array assignments or item additions/removals, pass the
deep:true
option (the 3rd argument towatch()
):
watch(
myArray 1️⃣,
() => { /* handle change */ },
{ deep: true } 2️⃣
)
Source:stackexchange.com