From: 丶远方 Date: Wed, 3 Jan 2024 10:18:45 +0000 (+0800) Subject: chore(apiWatch): constraint deep passes boolean (#9952) X-Git-Tag: v3.4.4~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe03b2f8bfb2d3d24e0c9c39a13cf561260c461a;p=thirdparty%2Fvuejs%2Fcore.git chore(apiWatch): constraint deep passes boolean (#9952) --- diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index 665fb4ec4d..7fbcc78f36 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -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(