Skip to content
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

Access shadowRoot inside defineCustomElement #6113

Closed
07akioni opened this issue Jun 14, 2022 · 1 comment
Closed

Access shadowRoot inside defineCustomElement #6113

07akioni opened this issue Jun 14, 2022 · 1 comment

Comments

@07akioni
Copy link
Contributor

What problem does this feature solve?

For CSS in JS component, it needs to mount some styles in shadowRoot before it's actually rendered. Seems currently there's no way to access it.

What does the proposed API look like?

Not sure. Maybe useShadowRoot if it can access shadow root before element is actually mounted.

defineCustomElement({
  setup () {
    const shadowRoot = useShadowRoot()
    // ... dynamically generate styles
    shadowRoot.appendChild(styleElement) 
  }
})

@yyx990803
Copy link
Member

closed via 5a1a89b

@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants