-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
fix(runtime-dom): v-model.number
work with select tag
#2308
Conversation
.map((o: HTMLOptionElement) => { | ||
const domValue = getValue(o) | ||
return castToNumber ? toNumber(domValue) : domValue | ||
}) |
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.
maybe no need to castToNumber?
every time in the .map
.
const selectedVal = castToNumber ? temp.map(o=>toNumber(getValue(o))) : temp.map(getValue)
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.
🐂B.
@@ -681,6 +681,43 @@ describe('vModel', () => { | |||
expect(bar.selected).toEqual(true) | |||
}) | |||
|
|||
it('v-model.number should work with select tag', async () => { |
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.
Maybe should include a test case for multiple select also?
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.
Done.Thanks~😄
fix #2252
I open a new PR and closed the old one #2254