Skip to content

Commit

Permalink
fix(vue3): wrap story with Suspense, fix #668
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Feb 6, 2024
1 parent c9735e8 commit 26dd6ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/histoire-plugin-vue/src/client/app/RenderStory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable vue/one-component-per-file */

import { App, createApp, onMounted, reactive, Component, h, VNode } from 'vue'
import { App, createApp, onMounted, reactive, Component, h, VNode, Suspense } from 'vue'
import {
defineComponent as _defineComponent,
onBeforeUnmount as _onBeforeUnmount,
Expand Down Expand Up @@ -118,6 +118,9 @@ export default _defineComponent({
)
}

// Wrap in Suspense to render async components
children.push(h(Suspense, {}, () => children.at(-1)))

return children.at(-1)
},
})
Expand Down

0 comments on commit 26dd6ed

Please sign in to comment.