return (_openBlock(), _createBlock(\\"input\\", {
modelValue:
- model
+ model
+.
+foo
,
\\"onUpdate:modelValue\\": $event => (
- model
+ model
+.
+foo
= $event)
}, null, 8 /* PROPS */, [\\"modelValue\\", \\"onUpdate:modelValue\\"]))
}
expect(generate(root, { mode: 'module' }).code).toMatchSnapshot()
})
+ // #2426
test('simple expression (with multilines)', () => {
- const root = parseWithVModel('<input v-model="\n model \n" />')
+ const root = parseWithVModel('<input v-model="\n model\n.\nfoo \n" />')
const node = root.children[0] as ElementNode
const props = ((node.codegenNode as VNodeCall).props as ObjectExpression)
.properties
isStatic: true
},
value: {
- content: '\n model \n',
+ content: '\n model\n.\nfoo \n',
isStatic: false
}
})
children: [
'$event => (',
{
- content: '\n model \n',
+ content: '\n model\n.\nfoo \n',
isStatic: false
},
' = $event)'
export const isSimpleIdentifier = (name: string): boolean =>
!nonIdentifierRE.test(name)
-const memberExpRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^\]]+\])*$/
+const memberExpRE = /^[A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*|\[[^\]]+\])*$/
export const isMemberExpression = (path: string): boolean => {
if (!path) return false
return memberExpRE.test(path.trim())