From 9cee1001e2e7a37b8e813aa9c1897c2863467880 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Fri, 28 Apr 2023 22:43:51 +0800 Subject: [PATCH] Merge pull request #22229 from storybookjs/kasper/vue3-reactivity-v6-compatible Vue3: Rollback v7 breaking change and keep reactive v6-compatible API --- code/renderers/vue3/src/decorateStory.ts | 2 +- code/renderers/vue3/src/render.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/renderers/vue3/src/decorateStory.ts b/code/renderers/vue3/src/decorateStory.ts index e2a56ec7204b..f63fdfb6ec82 100644 --- a/code/renderers/vue3/src/decorateStory.ts +++ b/code/renderers/vue3/src/decorateStory.ts @@ -64,7 +64,7 @@ export function decorateStory( return story; } - return prepare(decoratedStory, h(story, context.args)) as VueRenderer['storyResult']; + return prepare(decoratedStory, h(story)) as VueRenderer['storyResult']; }, (context) => prepare(storyFn(context)) as LegacyStoryFn ); diff --git a/code/renderers/vue3/src/render.ts b/code/renderers/vue3/src/render.ts index 640fc54d4e52..32e2b6a3f5e0 100644 --- a/code/renderers/vue3/src/render.ts +++ b/code/renderers/vue3/src/render.ts @@ -12,7 +12,7 @@ export const render: ArgsStoryFn = (props, context) => { ); } - return h(Component, props, getSlots(props, context)); + return () => h(Component, props, getSlots(props, context)); }; let setupFunction = (_app: any) => {}; @@ -54,7 +54,7 @@ export function renderToCanvas( const renderedElement: any = elementMap.get(canvasElement); const current = renderedElement && renderedElement.template ? renderedElement : element; map.set(canvasElement, { vueApp: storybookApp, reactiveArgs }); - return h(current, reactiveArgs); + return h(current); }, });