feat(runtime-core): add special property to get class component options (#821)

This commit is contained in:
Katashin
2020-03-12 23:46:32 +08:00
committed by GitHub
parent 1e9d1319c3
commit dd17fa1c90
4 changed files with 25 additions and 5 deletions

View File

@@ -46,6 +46,15 @@ describe('vnode', () => {
}
})
test('create with class component', () => {
class Component {
$props: any
static __vccOpts = { template: '<div />' }
}
const vnode = createVNode(Component)
expect(vnode.type).toEqual(Component.__vccOpts)
})
describe('class normalization', () => {
test('string', () => {
const vnode = createVNode('p', { class: 'foo baz' })