Skip to content

Support for async components #4

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
dryton opened this issue Jul 8, 2021 · 0 comments
Open

Support for async components #4

dryton opened this issue Jul 8, 2021 · 0 comments

Comments

@dryton
Copy link

dryton commented Jul 8, 2021

Vue 3 introduced defineAsyncComponent as a way to create components that load asynchronously:
https://v3.vuejs.org/api/global-api.html#defineasynccomponent

When you pass an async component to the wrapper it will load the component, but it fails to map props from the custom element through to the component.

You can test this out in your demo by updating main.js to:

import { createApp, defineAsyncComponent, h } from "vue";
import wrapper from "vue3-webcomponent-wrapper";
const Counter = defineAsyncComponent(() => import("./components/Counter.vue"));

const webComponent = wrapper(Counter, createApp, h);
window.customElements.define("demo-counter", webComponent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant