Skip to content

Commit

Permalink
fix(vue): codegen setup directives
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Apr 9, 2024
1 parent a6a9b81 commit 92f91cc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/histoire-plugin-vue/src/client/codegen.ts
Expand Up @@ -101,6 +101,15 @@ async function printVNode (vnode: VNode, propsOverrides: Record<string, any> = n
}
if (dirName) break
}
// Check in setup state
if (!dirName) {
for (const key in target.setupState) {
if (target.setupState[key] === dir.dir) {
dirName = key.replace(/^v(\w)/, (_, p1) => p1.toLowerCase())
break
}
}
}
if (dirName) {
genDirective(dirName, dir)
}
Expand Down

0 comments on commit 92f91cc

Please sign in to comment.