Skip to content

Commit 912f4be

Browse files
committed
refactor: add comments
1 parent 3b4c136 commit 912f4be

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/stubs.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,8 @@ export function stubComponents(
9191
transformVNodeArgs((args, instance: ComponentInternalInstance | null) => {
9292
const [nodeType, props, children, patchFlag, dynamicProps] = args
9393
const type = nodeType as VNodeTypes
94-
// args[0] can either be:
95-
// 1. a HTML tag (div, span...)
96-
// 2. An object of component options, such as { name: 'foo', render: [Function], props: {...} }
97-
// Depending what it is, we do different things.
94+
95+
// stub transition by default via config.global.stubs
9896
if (type === Transition && stubs['transition']) {
9997
return [
10098
createTransitionStub({ name: 'transition-stub', props: undefined }),
@@ -103,6 +101,7 @@ export function stubComponents(
103101
]
104102
}
105103

104+
// stub transition-group by default via config.global.stubs
106105
if (type === TransitionGroup && stubs['transition-group']) {
107106
return [
108107
createTransitionStub({
@@ -114,6 +113,10 @@ export function stubComponents(
114113
]
115114
}
116115

116+
// args[0] can either be:
117+
// 1. a HTML tag (div, span...)
118+
// 2. An object of component options, such as { name: 'foo', render: [Function], props: {...} }
119+
// Depending what it is, we do different things.
117120
if (
118121
isHTMLElement(type) ||
119122
isCommentOrFragment(type) ||

0 commit comments

Comments
 (0)