summaryrefslogtreecommitdiff
path: root/packages/integrations/vue/client.js
diff options
context:
space:
mode:
authorGravatar sammibajrami <contact@sammibajrami.me> 2024-10-05 13:48:30 +0200
committerGravatar GitHub <noreply@github.com> 2024-10-05 13:48:30 +0200
commitaf8401ebf9e5cbe94ded0d0f745ed1e3ec6f6d8a (patch)
treecdb267c1ff6ba342a6390610482a6f4b11794960 /packages/integrations/vue/client.js
parent5bc6223b1200baba9679a4dafea79c73486c275d (diff)
downloadastro-af8401ebf9e5cbe94ded0d0f745ed1e3ec6f6d8a.tar.gz
astro-af8401ebf9e5cbe94ded0d0f745ed1e3ec6f6d8a.tar.zst
astro-af8401ebf9e5cbe94ded0d0f745ed1e3ec6f6d8a.zip
Fixed an "Uncaught ReferenceError" inside of the @astrojs/vue package (#12116)
* fix(vue): initialized the 'app' variable earlier in the client.js script by assigning the 'appInstance' reference to it so that it is available for the later established 'astro:unmount' event listener * Add changeset * fix(vue): reverted the last change and instead moved the 'astro:unmount' event listener to inside of the 'if' statement where the 'app' variable is initialized --------- Co-authored-by: Matt Kane <m@mk.gg>
Diffstat (limited to 'packages/integrations/vue/client.js')
-rw-r--r--packages/integrations/vue/client.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/integrations/vue/client.js b/packages/integrations/vue/client.js
index b3935752c..4ec2b9e68 100644
--- a/packages/integrations/vue/client.js
+++ b/packages/integrations/vue/client.js
@@ -44,12 +44,12 @@ export default (element) =>
await setup(app);
app.mount(element, isHydrate);
appMap.set(element, appInstance);
+ element.addEventListener('astro:unmount', () => app.unmount(), { once: true });
} else {
appInstance.props = props;
appInstance.slots = slots;
appInstance.component.$forceUpdate();
}
- element.addEventListener('astro:unmount', () => app.unmount(), { once: true });
};
function isAsync(fn) {