Skip to content

Commit

Permalink
fix(vue): codegen: check before using in on nullable object (#688)
Browse files Browse the repository at this point in the history
Co-authored-by: Louis Haftmann <30736553+LouisHaftmann@users.noreply.github.com>
  • Loading branch information
DrJume and LouisHaftmann authored Mar 13, 2024
1 parent 692e6f5 commit 72a584b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/histoire-plugin-vue/src/client/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async function printVNode (vnode: VNode, propsOverrides: Record<string, any> = n
// v-model on component
const vmodelListeners = [`onUpdate:${prop}`, `onUpdate:${camelCase(prop)}`]
// @ts-ignore
const vmodelListener = vmodelListeners.find(key => vnode.dynamicProps?.includes(key) || key in vnode.props)
const vmodelListener = vmodelListeners.find(key => vnode.dynamicProps?.includes(key) || (vnode.props && key in vnode.props))
if (directive === ':' && vmodelListener) {
// Listener
skipProps.push(vmodelListener)
Expand Down

0 comments on commit 72a584b

Please sign in to comment.