-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Allow using full Vue application instance when defining Custom Element #4635
Comments
… in custom elements (see vuejs/core#4635).
This would likely also fix the issue with devtools not working in Custom Elements: |
Any progress on this one? We all need to realize that people use Vue to build full-featured custom element apps. Not only for small components as was intended. We need this! |
This would come in hand as we can create embeddable apps isolated from websites where we use them. Really powerful feature, but this has to work with styles as well, as by default it will inject the styles inside the root HTML and not the shadowed one. I experimented a little with this but it is not possible to satisfy my needs during development and production mode without some complex logic. |
I also wanted to do this. I figured out a workaround for my use case by having a 'shim' app intercept the equivalent calls a plugin might make. https://gist.github.com/scvnc/5ca1771cbcb199b0aa58b2a7094ecc62 Example successfully registering the PrimeVue plugin in a CE Vue component <script setup lang="ts">
import { useCeVueApp } from './useCeVueApp';
import PrimeVue from 'primevue/config'
useCeVueApp(app => {
app.use(PrimeVue);
});
</script> |
Hello Vue team, Do you have any plan for this feature? Regards. |
Is this still something that Vue will support? |
Closed via 6758c3c Note the design is a bit different from proposed - instead of passing in an already created app, custom elements now always have an associated app and can be configured via the defineCustomElement(VueComponent, {
configureApp(app) {
// ...
}
}) |
What problem does this feature solve?
It'd be useful to be able to use a full Vue instance when defining a custom element, i.e. to use plugins like Vue Router or Vuex within a custom element.
What does the proposed API look like?
The text was updated successfully, but these errors were encountered: