summaryrefslogtreecommitdiff
path: root/packages/integrations/vue
diff options
context:
space:
mode:
authorGravatar Bjorn Lu <bjornlu.dev@gmail.com> 2023-10-18 21:23:19 +0800
committerGravatar GitHub <noreply@github.com> 2023-10-18 21:23:19 +0800
commit65c7bd149cf9024f8026a73426d51c76be543cc4 (patch)
tree9af142c945eb48a2560ab5c2561ce87baf8a82e9 /packages/integrations/vue
parentc6e0d8e1cdf58e4cc797e86fb3cc4494e2111566 (diff)
downloadastro-65c7bd149cf9024f8026a73426d51c76be543cc4.tar.gz
astro-65c7bd149cf9024f8026a73426d51c76be543cc4.tar.zst
astro-65c7bd149cf9024f8026a73426d51c76be543cc4.zip
Fix Vue HMR for script tags (#8860)
Diffstat (limited to 'packages/integrations/vue')
-rw-r--r--packages/integrations/vue/client.js22
1 files changed, 13 insertions, 9 deletions
diff --git a/packages/integrations/vue/client.js b/packages/integrations/vue/client.js
index 8b2a5eede..7e1d8090e 100644
--- a/packages/integrations/vue/client.js
+++ b/packages/integrations/vue/client.js
@@ -14,16 +14,20 @@ export default (element) =>
slots[key] = () => h(StaticHtml, { value, name: key === 'default' ? undefined : key });
}
- let content = h(Component, props, slots);
- // related to https://github.com/withastro/astro/issues/6549
- // if the component is async, wrap it in a Suspense component
- if (isAsync(Component.setup)) {
- content = h(Suspense, null, content);
- }
-
const isHydrate = client !== 'only';
- const boostrap = isHydrate ? createSSRApp : createApp;
- const app = boostrap({ name, render: () => content });
+ const bootstrap = isHydrate ? createSSRApp : createApp;
+ const app = bootstrap({
+ name,
+ render() {
+ let content = h(Component, props, slots);
+ // related to https://github.com/withastro/astro/issues/6549
+ // if the component is async, wrap it in a Suspense component
+ if (isAsync(Component.setup)) {
+ content = h(Suspense, null, content);
+ }
+ return content;
+ },
+ });
await setup(app);
app.mount(element, isHydrate);