We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
3.4.27
https://stackblitz.com/edit/vitejs-vite-b5tzrx?file=src%2FApp.vue
我使用.ce.vue文件创建webcomponent组件,在.ce.vue文件内使用自定义的vue组件,发现vue组件的样式被放入了到页面的head标签里,没有像父组件那样也放入到shadow-root里,导致样式不生效,当我把vue组件的文件名也改为.ce.vue时,还是一样的效果。我查看vite的文档和源码,发现并没有开放可以设置css放入位置的配置。
在入口.ce.vue文件中,能够保持webcomponent上下文,内部的vue组件样式放入当前shadow-root中,不在放入html页面的head中,保持样式有效
内部vue组件的样式被放入了head中,样式丢失
No response
如果有vite的配置可以解决此种情况,希望得到帮助
The text was updated successfully, but these errors were encountered:
vue webcomponents里面不要使用vue组件吧,样式隔离了,vue组件可以使用vue webcomponetns
Sorry, something went wrong.
如果都用webcomponent的话,就会导致这种组件太多了,就会注册过多的webcomponent,而且会导致provide无法传值下去,书写上也会有较大的脑力负担。 我只是想创建一个webcomponent,用于开发跨技术栈的sdk,把组件和业务都内聚进去。内部用到的组件没有开放的必要性
duplicate of #4662
No branches or pull requests
Vue version
3.4.27
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-b5tzrx?file=src%2FApp.vue
Steps to reproduce
我使用.ce.vue文件创建webcomponent组件,在.ce.vue文件内使用自定义的vue组件,发现vue组件的样式被放入了到页面的head标签里,没有像父组件那样也放入到shadow-root里,导致样式不生效,当我把vue组件的文件名也改为.ce.vue时,还是一样的效果。我查看vite的文档和源码,发现并没有开放可以设置css放入位置的配置。
What is expected?
在入口.ce.vue文件中,能够保持webcomponent上下文,内部的vue组件样式放入当前shadow-root中,不在放入html页面的head中,保持样式有效
What is actually happening?
内部vue组件的样式被放入了head中,样式丢失
System Info
No response
Any additional comments?
如果有vite的配置可以解决此种情况,希望得到帮助
The text was updated successfully, but these errors were encountered: