summaryrefslogtreecommitdiff
path: root/packages/integrations/vue/client.js
diff options
context:
space:
mode:
authorGravatar Nate Moore <natemoo-re@users.noreply.github.com> 2022-10-13 14:15:57 -0500
committerGravatar GitHub <noreply@github.com> 2022-10-13 14:15:57 -0500
commitd25f54cb9306eea9ed0445af8f77604dacacad43 (patch)
treeb5b1c93b4c9a2685b052e3c39f91f916bf6b086f /packages/integrations/vue/client.js
parent6f9a88b31ba0881acd56fcb62c4a554c867b14d6 (diff)
downloadastro-d25f54cb9306eea9ed0445af8f77604dacacad43.tar.gz
astro-d25f54cb9306eea9ed0445af8f77604dacacad43.tar.zst
astro-d25f54cb9306eea9ed0445af8f77604dacacad43.zip
[Vue] add support for `appEntrypoint` (#5075)
* feat(vue): add support for appEntrypoint * chore: add changeset * test(vue): add tests for app entrypoint * docs(vue): update README to include app entrypoint * fix(vue): prefer resolvedVirtualModuleId Co-authored-by: Nate Moore <nate@astro.build>
Diffstat (limited to 'packages/integrations/vue/client.js')
-rw-r--r--packages/integrations/vue/client.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/integrations/vue/client.js b/packages/integrations/vue/client.js
index 648a69658..faf1ac63a 100644
--- a/packages/integrations/vue/client.js
+++ b/packages/integrations/vue/client.js
@@ -1,8 +1,9 @@
import { h, createSSRApp, createApp } from 'vue';
+import { setup } from 'virtual:@astrojs/vue/app'
import StaticHtml from './static-html.js';
export default (element) =>
- (Component, props, slotted, { client }) => {
+ async (Component, props, slotted, { client }) => {
delete props['class'];
if (!element.hasAttribute('ssr')) return;
@@ -14,9 +15,11 @@ export default (element) =>
}
if (client === 'only') {
const app = createApp({ name, render: () => h(Component, props, slots) });
+ await setup(app);
app.mount(element, false);
} else {
const app = createSSRApp({ name, render: () => h(Component, props, slots) });
+ await setup(app);
app.mount(element, true);
}
};