mirror of https://github.com/vuejs/core.git
Merge 1f0062c2c7
into 56be3dd4db
This commit is contained in:
commit
23b9b993dd
|
@ -471,6 +471,14 @@ describe('defineCustomElement', () => {
|
||||||
container.appendChild(e)
|
container.appendChild(e)
|
||||||
expect(e.shadowRoot!.innerHTML).toBe('<div></div>')
|
expect(e.shadowRoot!.innerHTML).toBe('<div></div>')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// #12408
|
||||||
|
test('should set number tabindex as attribute', () => {
|
||||||
|
render(h('my-el-attrs', { tabindex: 1, 'data-test': true }), container)
|
||||||
|
const el = container.children[0] as HTMLElement
|
||||||
|
expect(el.getAttribute('tabindex')).toBe('1')
|
||||||
|
expect(el.getAttribute('data-test')).toBe('true')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('emits', () => {
|
describe('emits', () => {
|
||||||
|
|
|
@ -60,7 +60,11 @@ export const patchProp: DOMRendererOptions['patchProp'] = (
|
||||||
} else if (
|
} else if (
|
||||||
// #11081 force set props for possible async custom element
|
// #11081 force set props for possible async custom element
|
||||||
(el as VueElement)._isVueCE &&
|
(el as VueElement)._isVueCE &&
|
||||||
(/[A-Z]/.test(key) || !isString(nextValue))
|
// #12408 check if it's hyphen prop or it's async custom element
|
||||||
|
(camelize(key) in el ||
|
||||||
|
// @ts-expect-error _def is private
|
||||||
|
((el as VueElement)._def.__asyncLoader &&
|
||||||
|
(/[A-Z]/.test(key) || !isString(nextValue))))
|
||||||
) {
|
) {
|
||||||
patchDOMProp(el, camelize(key), nextValue, parentComponent, key)
|
patchDOMProp(el, camelize(key), nextValue, parentComponent, key)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue