From: daiwei Date: Tue, 15 Apr 2025 03:47:54 +0000 (+0800) Subject: chore: update X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=252f647b2147679e52e34e35f70a37498b23ad65;p=thirdparty%2Fvuejs%2Fcore.git chore: update --- diff --git a/packages-private/vapor-e2e-test/package.json b/packages-private/vapor-e2e-test/package.json index d5d358f3cf..66ea0457ec 100644 --- a/packages-private/vapor-e2e-test/package.json +++ b/packages-private/vapor-e2e-test/package.json @@ -5,7 +5,7 @@ "type": "module", "scripts": { "dev": "vite dev", - "build": "vite build && vite preview" + "build": "vite build" }, "devDependencies": { "@types/connect": "^3.4.38", diff --git a/packages/runtime-vapor/src/component.ts b/packages/runtime-vapor/src/component.ts index e66d82b5c6..e7d9db5de6 100644 --- a/packages/runtime-vapor/src/component.ts +++ b/packages/runtime-vapor/src/component.ts @@ -174,9 +174,9 @@ export function createComponent( ) // TODO: problem is `frag.insert` will be called multiple times // if used in v-if - // if (!isHydrating && _insertionParent) { - // insert(frag, _insertionParent, _insertionAnchor) - // } + if (!isHydrating && _insertionParent && !isKeepAlive(currentInstance)) { + insert(frag, _insertionParent, _insertionAnchor) + } return frag } diff --git a/packages/runtime-vapor/src/components/KeepAlive.ts b/packages/runtime-vapor/src/components/KeepAlive.ts index 8ccc6d5538..0674cd5a8e 100644 --- a/packages/runtime-vapor/src/components/KeepAlive.ts +++ b/packages/runtime-vapor/src/components/KeepAlive.ts @@ -183,13 +183,11 @@ export const VaporKeepAliveImpl: ObjectVaporComponent = defineVaporComponent({ } function pruneCacheEntry(key: CacheKey) { - const cached = cache.get(key) - if (cached) { - resetShapeFlag(cached) - // don't unmount if the instance is the current one - if (cached !== current) { - remove(cached) - } + const cached = cache.get(key)! + resetShapeFlag(cached) + // don't unmount if the instance is the current one + if (cached !== current) { + remove(cached) } cache.delete(key) keys.delete(key)