Skip to content

Commit 252f647

Browse files
committed
chore: update
1 parent 90f23e2 commit 252f647

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

packages-private/vapor-e2e-test/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite dev",
8-
"build": "vite build && vite preview"
8+
"build": "vite build"
99
},
1010
"devDependencies": {
1111
"@types/connect": "^3.4.38",

packages/runtime-vapor/src/component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ export function createComponent(
174174
)
175175
// TODO: problem is `frag.insert` will be called multiple times
176176
// if used in v-if
177-
// if (!isHydrating && _insertionParent) {
178-
// insert(frag, _insertionParent, _insertionAnchor)
179-
// }
177+
if (!isHydrating && _insertionParent && !isKeepAlive(currentInstance)) {
178+
insert(frag, _insertionParent, _insertionAnchor)
179+
}
180180
return frag
181181
}
182182

packages/runtime-vapor/src/components/KeepAlive.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,11 @@ export const VaporKeepAliveImpl: ObjectVaporComponent = defineVaporComponent({
183183
}
184184

185185
function pruneCacheEntry(key: CacheKey) {
186-
const cached = cache.get(key)
187-
if (cached) {
188-
resetShapeFlag(cached)
189-
// don't unmount if the instance is the current one
190-
if (cached !== current) {
191-
remove(cached)
192-
}
186+
const cached = cache.get(key)!
187+
resetShapeFlag(cached)
188+
// don't unmount if the instance is the current one
189+
if (cached !== current) {
190+
remove(cached)
193191
}
194192
cache.delete(key)
195193
keys.delete(key)

0 commit comments

Comments
 (0)