Skip to content

Commit

Permalink
fix: dynamic v-on and static v-on should be merged
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Sep 25, 2022
1 parent 96ba71d commit 86c3509
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/compiler-core/src/transforms/transformElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,17 @@ export function buildProps(
// has built-in directive transform.
const { props, needRuntime } = directiveTransform(prop, node, context)
!ssr && props.forEach(analyzePatchFlag)
properties.push(...props)
if (arg && !isStaticExp(arg)) {
if (properties.length) {
mergeArgs.push(
createObjectExpression(dedupeProperties(properties), elementLoc)
)
properties = []
}
mergeArgs.push(createObjectExpression(props, elementLoc))
} else {
properties.push(...props)
}
if (needRuntime) {
runtimeDirectives.push(prop)
if (isSymbol(needRuntime)) {
Expand Down

0 comments on commit 86c3509

Please sign in to comment.