Skip to content

Commit

Permalink
wip: handle v-show in ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
linzhe141 committed Oct 14, 2024
1 parent 770ea67 commit 7fcdf4e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/compiler-ssr/src/transforms/ssrTransformElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,15 @@ export const ssrTransformElement: NodeTransform = (node, context) => {
)
const needMergeProps = hasDynamicVBind || hasCustomDir
if (needMergeProps) {
const vShowPropIndex = node.props.findIndex(
i => i.type === NodeTypes.DIRECTIVE && i.rawName === 'v-show',
)
const { props, directives } = buildProps(
node,
context,
node.props,
vShowPropIndex === -1
? node.props
: node.props.splice(vShowPropIndex, 1),
false /* isComponent */,
false /* isDynamicComponent */,
true /* ssr */,
Expand Down

0 comments on commit 7fcdf4e

Please sign in to comment.