This repository was archived by the owner on May 20, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ const _removeKeepAlive = (
3939) : void => {
4040 const element = map . get ( id ) ;
4141 if ( element ) {
42+ ( element . children as unknown as ElementNode ) . destroy ( ) ;
4243 element . dispose ( ) ;
4344 map . delete ( id ) ;
4445 }
@@ -50,7 +51,10 @@ export const removeKeepAliveRoute = (id: string): void =>
5051 _removeKeepAlive ( keepAliveRouteElements , id ) ;
5152
5253const _clearKeepAlive = ( map : Map < string , KeepAliveElement > ) : void => {
53- map . forEach ( ( element ) => element . dispose ( ) ) ;
54+ map . forEach ( ( element ) => {
55+ ( element . children as unknown as ElementNode ) . destroy ( ) ;
56+ element . dispose ( ) ;
57+ } ) ;
5458 map . clear ( ) ;
5559} ;
5660
@@ -103,6 +107,7 @@ const createKeepAliveComponent = (
103107 ( props . shouldDispose ?.( props . id ) ||
104108 ( existing . children as unknown as ElementNode ) ?. destroyed )
105109 ) {
110+ ( existing . children as unknown as ElementNode ) . destroy ( ) ;
106111 existing . dispose ( ) ;
107112 map . delete ( props . id ) ;
108113 existing = undefined ;
@@ -184,6 +189,7 @@ export const KeepAliveRoute = <S extends string>(
184189 ( props . shouldDispose ?.( key ) ||
185190 ( existing . children as unknown as ElementNode ) ?. destroyed )
186191 ) {
192+ ( existing . children as unknown as ElementNode ) . destroy ( ) ;
187193 existing . dispose ( ) ;
188194 keepAliveRouteElements . delete ( key ) ;
189195 existing = undefined ;
You can’t perform that action at this time.
0 commit comments