feat(runtime-core): support variadic children in h for simple JSX compat

ref: #1917
This commit is contained in:
Evan You
2020-08-21 21:54:33 -04:00
parent 6602d6dbff
commit 54d06ec495
2 changed files with 21 additions and 2 deletions

View File

@@ -64,4 +64,20 @@ describe('renderer: h', () => {
})
)
})
// for simple JSX compat
// note this signature is not supported in types; it's purely for usage with
// compiled code.
test('support variadic children', () => {
// @ts-ignore
const vnode = h('div', null, h('span'), h('span'))
expect(vnode.children).toMatchObject([
{
type: 'span'
},
{
type: 'span'
}
])
})
})