const n2 = _createComponentWithFallback(_component_Bar)
_withVaporDirectives(n2, [[_directive_hello, void 0, void 0, { world: true }]])
return n3
- })
+ }, null, true)
return n0
})
}, true)
const n1 = _createIf(() => (true), () => {
const n3 = t0()
return n3
- })
+ }, null, true)
_renderEffect(() => _setProp(n4, "disabled", _ctx.foo))
return n6
}"
test('v-if + v-else-if + v-else', () => {
const { code, ir } = compileWithVIf(
- `<div v-if="ok"/><p v-else-if="orNot"/><template v-else>fine</template>`,
+ `<div v-if="ok"/><p v-else-if="orNot"/><p v-else-if="false"/><template v-else>fine</template>`,
)
expect(code).matchSnapshot()
expect(ir.template).toEqual(['<div></div>', '<p></p>', 'fine'])
},
},
negative: {
- type: IRNodeTypes.BLOCK,
- dynamic: {
- children: [{ template: 2 }],
+ type: IRNodeTypes.IF,
+ negative: {
+ type: IRNodeTypes.BLOCK,
+ dynamic: {
+ children: [{ template: 2 }],
+ },
},
},
},
if (node.ast) {
return isConstantNode(node.ast, bindings)
} else if (node.ast === null) {
+ if (
+ !node.isStatic &&
+ (node.content === 'true' || node.content === 'false')
+ ) {
+ return true
+ }
const type = bindings[node.content]
return type === BindingTypes.LITERAL_CONST
}