types: fix typing
This commit is contained in:
parent
7950980dc3
commit
02e9fe3f7d
@ -45,7 +45,7 @@ export type VNodeChild<HostNode = any, HostElement = any> =
|
|||||||
| VNodeChildAtom<HostNode, HostElement>
|
| VNodeChildAtom<HostNode, HostElement>
|
||||||
| VNodeChildren<HostNode, HostElement>
|
| VNodeChildren<HostNode, HostElement>
|
||||||
|
|
||||||
export type NormalizedChildren<HostNode, HostElement> =
|
export type NormalizedChildren<HostNode = any, HostElement = any> =
|
||||||
| string
|
| string
|
||||||
| VNodeChildren<HostNode, HostElement>
|
| VNodeChildren<HostNode, HostElement>
|
||||||
| RawSlots
|
| RawSlots
|
||||||
@ -226,7 +226,7 @@ export function cloneVNode(vnode: VNode): VNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function normalizeVNode(child: VNodeChild<any, any>): VNode {
|
export function normalizeVNode(child: VNodeChild): VNode {
|
||||||
if (child == null) {
|
if (child == null) {
|
||||||
// empty placeholder
|
// empty placeholder
|
||||||
return createVNode(Empty)
|
return createVNode(Empty)
|
||||||
@ -258,7 +258,7 @@ export function normalizeChildren(vnode: VNode, children: unknown) {
|
|||||||
children = isString(children) ? children : children + ''
|
children = isString(children) ? children : children + ''
|
||||||
type = ShapeFlags.TEXT_CHILDREN
|
type = ShapeFlags.TEXT_CHILDREN
|
||||||
}
|
}
|
||||||
vnode.children = children as NormalizedChildren<any, any>
|
vnode.children = children as NormalizedChildren
|
||||||
vnode.shapeFlag |= type
|
vnode.shapeFlag |= type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user