File tree 2 files changed +5
-5
lines changed 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
- import type { VTUVNodeTypeTransformer } from './util'
1
+ import { isKeepAlive , isTeleport , VTUVNodeTypeTransformer } from './util'
2
2
import {
3
3
Transition ,
4
4
TransitionGroup ,
@@ -115,7 +115,7 @@ export function createStubComponentsTransformer({
115
115
} : CreateStubComponentsTransformerConfig ) : VTUVNodeTypeTransformer {
116
116
return function componentsTransformer ( type , instance ) {
117
117
// stub teleport by default via config.global.stubs
118
- if ( ( type as any ) === Teleport && 'teleport' in stubs ) {
118
+ if ( isTeleport ( type ) && 'teleport' in stubs ) {
119
119
if ( stubs . teleport === false ) return type
120
120
121
121
return createStub ( {
@@ -126,7 +126,7 @@ export function createStubComponentsTransformer({
126
126
}
127
127
128
128
// stub keep-alive/KeepAlive by default via config.global.stubs
129
- if ( ( type as any ) === KeepAlive && ( 'keep-alive' in stubs || 'KeepAlive' in stubs ) ) {
129
+ if ( isKeepAlive ( type ) && ( 'keep-alive' in stubs || 'KeepAlive' in stubs ) ) {
130
130
if ( 'keep-alive' in stubs && stubs [ 'keep-alive' ] === false ) return type
131
131
if ( 'KeepAlive' in stubs && stubs [ 'KeepAlive' ] === false ) return type
132
132
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ export type VTUVNodeTypeTransformer = (
20
20
instance : InstanceArgsType
21
21
) => VNodeTransformerInputComponentType
22
22
23
- const isTeleport = ( type : any ) : boolean => type . __isTeleport
24
- const isKeepAlive = ( type : any ) : boolean => type . __isKeepAlive
23
+ export const isTeleport = ( type : any ) : boolean => type . __isTeleport
24
+ export const isKeepAlive = ( type : any ) : boolean => type . __isKeepAlive
25
25
26
26
export const createVNodeTransformer = ( {
27
27
transformers
You can’t perform that action at this time.
0 commit comments