From: Yang Mingshan Date: Wed, 8 Jan 2020 17:06:16 +0000 (+0800) Subject: fix(watch): remove recorded effect on manual stop (#590) X-Git-Tag: v3.0.0-alpha.2~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=453e6889da22e7224b638261a32438bdf5c62e41;p=thirdparty%2Fvuejs%2Fcore.git fix(watch): remove recorded effect on manual stop (#590) --- diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index 0bcfbde147..4760344c4a 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -217,6 +217,13 @@ function doWatch( recordEffect(runner) return () => { stop(runner) + if (instance) { + const effects = instance.effects! + const index = effects.indexOf(runner) + if (index > -1) { + effects.splice(index, 1) + } + } } }