feat(compiler-dom/runtime-dom): stringify eligible static trees
This commit is contained in:
@@ -39,6 +39,7 @@ export const Portal = (Symbol(__DEV__ ? 'Portal' : undefined) as any) as {
|
||||
}
|
||||
export const Text = Symbol(__DEV__ ? 'Text' : undefined)
|
||||
export const Comment = Symbol(__DEV__ ? 'Comment' : undefined)
|
||||
export const Static = Symbol(__DEV__ ? 'Static' : undefined)
|
||||
|
||||
export type VNodeTypes =
|
||||
| string
|
||||
@@ -46,6 +47,7 @@ export type VNodeTypes =
|
||||
| typeof Fragment
|
||||
| typeof Portal
|
||||
| typeof Text
|
||||
| typeof Static
|
||||
| typeof Comment
|
||||
| typeof SuspenseImpl
|
||||
|
||||
@@ -328,6 +330,10 @@ export function createTextVNode(text: string = ' ', flag: number = 0): VNode {
|
||||
return createVNode(Text, null, text, flag)
|
||||
}
|
||||
|
||||
export function createStaticVNode(content: string): VNode {
|
||||
return createVNode(Static, null, content)
|
||||
}
|
||||
|
||||
export function createCommentVNode(
|
||||
text: string = '',
|
||||
// when used as the v-else branch, the comment node must be created as a
|
||||
|
||||
Reference in New Issue
Block a user