feat(transition): base transition component
This commit is contained in:
@@ -39,6 +39,9 @@ export interface KeepAliveSink {
|
||||
deactivate: (vnode: VNode) => void
|
||||
}
|
||||
|
||||
export const isKeepAlive = (vnode: VNode): boolean =>
|
||||
(vnode.type as any).__isKeepAlive
|
||||
|
||||
const KeepAliveImpl = {
|
||||
name: `KeepAlive`,
|
||||
|
||||
@@ -47,6 +50,12 @@ const KeepAliveImpl = {
|
||||
// would prevent it from being tree-shaken.
|
||||
__isKeepAlive: true,
|
||||
|
||||
props: {
|
||||
include: [String, RegExp, Array],
|
||||
exclude: [String, RegExp, Array],
|
||||
max: [String, Number]
|
||||
},
|
||||
|
||||
setup(props: KeepAliveProps, { slots }: SetupContext) {
|
||||
const cache: Cache = new Map()
|
||||
const keys: Keys = new Set()
|
||||
@@ -200,14 +209,6 @@ const KeepAliveImpl = {
|
||||
}
|
||||
}
|
||||
|
||||
if (__DEV__) {
|
||||
;(KeepAliveImpl as any).props = {
|
||||
include: [String, RegExp, Array],
|
||||
exclude: [String, RegExp, Array],
|
||||
max: [String, Number]
|
||||
}
|
||||
}
|
||||
|
||||
// export the public type for h/tsx inference
|
||||
export const KeepAlive = (KeepAliveImpl as any) as {
|
||||
new (): {
|
||||
|
||||
Reference in New Issue
Block a user