customElements.define('my-el-upgrade', E)
expect(el.shadowRoot.innerHTML).toBe(`foo: hello`)
})
+
+ // https://github.com/vuejs/core/issues/6163
+ test('handle components with no props', async () => {
+ const E = defineCustomElement({
+ render() {
+ return h('div', 'foo')
+ }
+ })
+ customElements.define('my-element-noprops', E)
+ const el = document.createElement('my-element-noprops')
+ container.appendChild(el)
+ await nextTick()
+ expect(el.shadowRoot!.innerHTML).toMatchInlineSnapshot('"<div>foo</div>"')
+ })
})
describe('emits', () => {
}).observe(this, { attributes: true })
const resolve = (def: InnerComponentDef) => {
- const { props, styles } = def
+ const { props = {}, styles } = def
const hasOptions = !isArray(props)
const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : []