fix(compiler-dom): comments in the v-if branchs should be ignored when used in Transition (#3622)

fix #3619
This commit is contained in:
HcySunYang
2021-05-25 05:10:29 +08:00
committed by GitHub
parent 3ef1fcc859
commit 7c74feb3dc
3 changed files with 58 additions and 2 deletions

View File

@@ -138,3 +138,21 @@ describe('compiler warnings', () => {
})
})
})
test('the v-if/else-if/else branchs in Transition should ignore comments', () => {
expect(
compile(`
<transition>
<div v-if="a">hey</div>
<!-- this should be ignored -->
<div v-else-if="b">hey</div>
<!-- this should be ignored -->
<div v-else>
<p v-if="c"/>
<!-- this should not be ignored -->
<p v-else/>
</div>
</transition>
`).code
).toMatchSnapshot()
})