]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore(apiWatch): constraint deep passes boolean (#9952)
author丶远方 <yangpanteng@gmail.com>
Wed, 3 Jan 2024 10:18:45 +0000 (18:18 +0800)
committerGitHub <noreply@github.com>
Wed, 3 Jan 2024 10:18:45 +0000 (18:18 +0800)
packages/runtime-core/src/apiWatch.ts

index 665fb4ec4df1c4aae50e6f12c50b26f9fec350d3..7fbcc78f36fb9ad25e1fb4190e880f1e4fc6829a 100644 (file)
@@ -189,6 +189,14 @@ function doWatch(
     }
   }
 
+  // TODO remove in 3.5
+  if (__DEV__ && deep !== void 0 && typeof deep === 'number') {
+    warn(
+      `watch() "deep" option with number value will be used as watch depth in future versions. ` +
+        `Please use a boolean instead to avoid potential breakage.`,
+    )
+  }
+
   if (__DEV__ && !cb) {
     if (immediate !== undefined) {
       warn(