From b75bfc8cc41f5c631c10055b78670fdc26dff23a Mon Sep 17 00:00:00 2001 From: Johannes Spohr Date: Tue, 17 Sep 2024 14:54:49 +0200 Subject: [PATCH] Fix vue resetting state when using view transition persistence (#11946) * Fix vue resetting state when using view transition persistence * Avoid calling internal apis when forcing vue component update --- .changeset/five-walls-build.md | 5 ++ .../src/components/VueCounter.vue | 12 +++-- .../src/pages/island-vue-one.astro | 11 +++++ .../src/pages/island-vue-two.astro | 11 +++++ packages/astro/e2e/view-transitions.test.js | 20 +++++++- packages/integrations/vue/client.js | 46 +++++++++++++------ 6 files changed, 87 insertions(+), 18 deletions(-) create mode 100644 .changeset/five-walls-build.md create mode 100644 packages/astro/e2e/fixtures/view-transitions/src/pages/island-vue-one.astro create mode 100644 packages/astro/e2e/fixtures/view-transitions/src/pages/island-vue-two.astro diff --git a/.changeset/five-walls-build.md b/.changeset/five-walls-build.md new file mode 100644 index 000000000000..41f89aa3e2e3 --- /dev/null +++ b/.changeset/five-walls-build.md @@ -0,0 +1,5 @@ +--- +'@astrojs/vue': patch +--- + +Fix vue islands keeping their state when using view transition persistence diff --git a/packages/astro/e2e/fixtures/view-transitions/src/components/VueCounter.vue b/packages/astro/e2e/fixtures/view-transitions/src/components/VueCounter.vue index e75620aff455..e05cf6a1445f 100644 --- a/packages/astro/e2e/fixtures/view-transitions/src/components/VueCounter.vue +++ b/packages/astro/e2e/fixtures/view-transitions/src/components/VueCounter.vue @@ -1,8 +1,8 @@