Skip to content

feat: allow multiline expression on v_model and v_on#1234

Merged
yyx990803 merged 1 commit intovuejs:masterfrom
pikax:feat/allow_multilines_on_vmodel_and_von
Jun 9, 2020
Merged

feat: allow multiline expression on v_model and v_on#1234
yyx990803 merged 1 commit intovuejs:masterfrom
pikax:feat/allow_multilines_on_vmodel_and_von

Conversation

@pikax
Copy link
Copy Markdown
Member

@pikax pikax commented May 25, 2020

fixes #1218

Comment on lines 86 to +90
const memberExpRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^\]]+\])*$/
export const isMemberExpression = (path: string): boolean =>
memberExpRE.test(path)
export const isMemberExpression = (path: string): boolean => {
if (!path) return false
return memberExpRE.test(path.trim())
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be done by only regular expression

^[A-Za-z_$\s][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^\]]+\]|\s)*$

But I think using trim is a bit more explicit than changing the regex

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not support v-model="obj[keys[name]]"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nor getModel(key).value

@takhello
Copy link
Copy Markdown

err~

v-model="getColumn(rowIndex, index)._filterVisible"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multiline v-model expressions

5 participants