-
Notifications
You must be signed in to change notification settings - Fork 29
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: 🎨 support undefined modelValue #895
Conversation
✅ Deploy Preview for vue-dsfr-demo ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
359bba8
to
d540cc9
Compare
d540cc9
to
f8b8dfd
Compare
modelValue?: string | number | ||
modelValue?: string |
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.
Pourquoi ?
@@ -1,12 +1,13 @@ | |||
export type DsfrSelectOption = string | { value: string, text: string, disabled?: boolean } |
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.
Pourquoi il n’y a plus undefined
?
value="" | ||
:selected="modelValue == null" | ||
:value="undefined" | ||
:selected="typeof modelValue === 'undefined'" |
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.
Pourquoi seulement si modelValue est undefined ? (actuellement, c’est si modelValue est nullish)
:selected="modelValue === option || (typeof option === 'object' && option.value === modelValue)" | ||
:selected="(typeof option === 'object' && option.value === modelValue) || modelValue === option" |
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.
Qu’apporte ce changement ?
No description provided.