-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
refactor($compile): Disable warn if v-model is used with ternary text-like types for input. #6227
refactor($compile): Disable warn if v-model is used with ternary text-like types for input. #6227
Conversation
Disable warn if v-model is used with ternary text-like types for input
5bfb797
to
a62d82a
Compare
@@ -4,6 +4,7 @@ import config from 'core/config' | |||
import { addHandler, addProp, getBindingAttr } from 'compiler/helpers' | |||
import { genComponentModel, genAssignmentCode } from 'compiler/directives/model' | |||
|
|||
const ternaryTextInputRE = /^[^?]{1,}\?\s*('|"|`)(?:text|number|password|search|email|tel|url)\1\s*:\s*('|"|`)(?:text|number|password|search|email|tel|url)\2\s*$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does a regexp like this introduce too much complexity that's not worth it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't use makeMap be enough? Don't we want to check if dynamic type is one of those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, you actually did that an #6344
we need the opposite 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant for the makeMap
function 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah, we could use
/^[^?]{1,}\?\s*('|"|`)([a-z]*)\1\s*:\s*('|"|`)([a-z]*)\3\s*$/
and just checks [2]
and [4]
with makeMap
. I'll add this changes to #6344 instead because isTextInputType
is moved over there.
Move to #6344 |
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
dev
branch for v2.x (or to a previous version branch), not themaster
branchfix #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information:
#6158