-
-
Notifications
You must be signed in to change notification settings - Fork 55
fix(select): handle null
& undefined
as default values
#179
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
Conversation
❌ Deploy Preview for anu-vue failed.
|
@@ -107,7 +115,7 @@ function middleware() { | |||
ref="selectRef" | |||
readonly | |||
class="a-select-input cursor-pointer" | |||
:value="modelValue.text ?? modelValue" | |||
:value="selectedValueText" |
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.
What if we change it to modelValue ? (modelValue.text ?? modelValue) : undefined
I guess this will probably work the same as the new changes but with less code
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.
Yep,it can be changed to this, I do this just for readability.
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.
Hey @IcetCode Can you please use props.modelValue
instead of direct use of modelValue
for future compatibility in template block? Anu defaults requires using props.x
in template block.
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.
like this?
:value="props.modelValue ? props.modelValue.text ?? props.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.
Yes 💯
null
& undefined
as default values
Thanks 😇 |
fix #178