fix(attr-fallthrough): ensure consistent attr fallthrough for root fragments with comments

fix #2549
This commit is contained in:
Evan You
2020-11-27 18:04:26 -05:00
parent 3532b2b021
commit 3bc2914e32
5 changed files with 170 additions and 88 deletions

View File

@@ -13,6 +13,7 @@ import {
createCommentVNode,
Fragment
} from '@vue/runtime-dom'
import { PatchFlags } from '@vue/shared/src'
describe('attribute fallthrough', () => {
it('should allow attrs to fallthrough', async () => {
@@ -574,11 +575,16 @@ describe('attribute fallthrough', () => {
setup() {
return () => (
openBlock(),
createBlock(Fragment, null, [
createCommentVNode('hello'),
h('button'),
createCommentVNode('world')
])
createBlock(
Fragment,
null,
[
createCommentVNode('hello'),
h('button'),
createCommentVNode('world')
],
PatchFlags.STABLE_FRAGMENT | PatchFlags.DEV_ROOT_FRAGMENT
)
)
}
}