Skip to content

Commit 74d89b9

Browse files
committed
fix(runtime-dom): allow specifying additional options for for custom elements
close 12964
1 parent 8bd9cdb commit 74d89b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/runtime-dom/src/apiCustomElement.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export type VueElementConstructor<P = {}> = {
5353
export interface CustomElementOptions {
5454
styles?: string[]
5555
shadowRoot?: boolean
56+
shadowRootOptions?: ShadowRootInit
5657
nonce?: string
5758
configureApp?: (app: App) => void
5859
}
@@ -263,7 +264,7 @@ export class VueElement
263264
)
264265
}
265266
if (_def.shadowRoot !== false) {
266-
this.attachShadow({ mode: 'open' })
267+
this.attachShadow({ mode: 'open', ..._def.shadowRootOptions })
267268
this._root = this.shadowRoot!
268269
} else {
269270
this._root = this

0 commit comments

Comments
 (0)