8000 feat(custom-element): allow specifying additional options for `shadowRoot` in custom elements by padcom · Pull Request #12965 · vuejs/core · GitHub
[go: up one dir, main page]

Skip to content

feat(custom-element): allow specifying additional options for shadowRoot in custom elements #12965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(runtime-dom): ensure mode is always 'open' when attaching shadow…
…Root
  • Loading branch information
padcom committed Mar 6, 2025
commit f50f53582aa7c3e75b9e87b0520ee02dccf2b86c
4 changes: 2 additions & 2 deletions packages/runtime-dom/src/apiCustomElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export type VueElementConstructor<P = {}> = {
export interface CustomElementOptions {
styles?: string[]
shadowRoot?: boolean
shadowRootOptions?: ShadowRootInit
shadowRootOptions?: Omit<ShadowRootInit, 'mode'>
nonce?: string
configureApp?: (app: App) => void
}
Expand Down Expand Up @@ -264,7 +264,7 @@ export class VueElement
)
}
if (_def.shadowRoot !== false) {
this.attachShadow(extend({ mode: 'open' }, _def.shadowRootOptions))
this.attachShadow(extend({}, _def.shadowRootOptions, { mode: 'open' }) as ShadowRootInit)
this._root = this.shadowRoot!
} else {
this._root = this
Expand Down
0