[compiler] What is IfNode
and NodeTypes.IF
#6558
Unanswered
marekvospel
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In the declarations of
@vue/compiler-sfc
I've noticed there is a Node calledIfNode
, which confused me, as vue uses directives for conditional rendering. (v-if
)While exploring the output of
@vue/compiler-sfc
I found that indeed,v-if
directive are directives, and that there is noIfNode
in the output ast.Looking trough the code of
@vue/compiler-core
, I've found aparseWithIfTransform
function in the tests, that transforms the ast and addsIfNode
. (use)That made me think that
IfNode
is just a testing node, and that it can't be returned by@vue/compiler-core
or@vue/compiler-sfc
and others.Is that correct? Or is there a way to enable the
ifTransform
or get theIfNode
in the parse results?Beta Was this translation helpful? Give feedback.
All reactions