fix(compiler-core/v-on): handle falsy values when caching v-on handlers
fix #2605
This commit is contained in:
@@ -108,9 +108,9 @@ export const transformOn: DirectiveTransform = (
|
||||
// avoiding the need to be patched.
|
||||
if (shouldCache && isMemberExp) {
|
||||
if (exp.type === NodeTypes.SIMPLE_EXPRESSION) {
|
||||
exp.content += `(...args)`
|
||||
exp.content = `${exp.content} && ${exp.content}(...args)`
|
||||
} else {
|
||||
exp.children.push(`(...args)`)
|
||||
exp.children = [...exp.children, ` && `, ...exp.children, `(...args)`]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user