fix(compiler-core/v-on): fix codegen for event handler with newlines (#1640)

This commit is contained in:
HcySunYang
2020-07-19 23:48:26 +08:00
committed by GitHub
parent fa5ddf8d06
commit f9826fa963
2 changed files with 51 additions and 1 deletions

View File

@@ -16,7 +16,7 @@ import { validateBrowserExpression } from '../validateExpression'
import { isMemberExpression, hasScopeRef } from '../utils'
import { CAPITALIZE } from '../runtimeHelpers'
const fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/
const fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^\s*function(?:\s+[\w$]+)?\s*\(/
export interface VOnDirectiveNode extends DirectiveNode {
// v-on without arg is handled directly in ./transformElements.ts due to it affecting