Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow multiline expression on v_model and v_on #1234

Merged

Conversation

pikax
Copy link
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
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

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]]"

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

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