-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Vue web component nested styling #5731
Comments
Is there any update regarding this? Looks to me as if the styling is not correctly inserted in the built XX.iife.js file: |
I have the same problem, discovered over internet a fix "https://stackoverflow.com/questions/69834745/how-to-register-and-use-props-correctly-in-new-vue-custom-element/69844449" but with it slots element are broken. |
This is caused by vuejs/core#4662. Not sure if Vite is the right place to fix it. |
Closing as it has already been tracked in the Vue 3 repo. |
Describe the bug
Currently when you import a child component and compile with the
lib
option for web components the sub-components styling is lost.I'm posting the bug in vite as I'm fairly confident that this has to do with the
@vite/plugin-vue
package as I'm using the new web component features described here: https://github.com/vitejs/vite/tree/main/packages/plugin-vue#using-vue-sfcs-as-custom-elementsReproduction
Here is a repo with a minimal reproduction of the issue: https://github.com/DerrikMilligan/vite-vue-web-component-child-style-issue
Here is what the output looks like. When using the
NestedComponent
as its own web component it has correct styling, but when it's imported into theHelloWorld
component and used it loses all of it's stylingSystem Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: