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

fix(types): allow undefined in StyleValue #7954

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

yuwu9145
Copy link
Contributor

@yuwu9145 yuwu9145 commented Mar 25, 2023

fix #7955

@yuwu9145 yuwu9145 marked this pull request as ready for review March 25, 2023 05:40
yuwu9145 added a commit to yuwu9145/vue-next that referenced this pull request Mar 25, 2023
yuwu9145 added a commit to yuwu9145/vue-next that referenced this pull request Mar 25, 2023
@sxzz sxzz changed the title fix(type): allow undefined in styleValue fix(types): allow undefined in styleValue Mar 25, 2023
yuwu9145 added a commit to yuwu9145/vue-next that referenced this pull request Mar 26, 2023
@sxzz sxzz changed the title fix(types): allow undefined in styleValue fix(types): allow undefined in StyleValue Mar 28, 2023
@@ -234,7 +234,7 @@ interface AriaAttributes {
}

// Vue's style normalization supports nested arrays
export type StyleValue = string | CSSProperties | Array<StyleValue>
export type StyleValue = undefined | string | CSSProperties | Array<StyleValue>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can also support all the falsy value, like null, false

Copy link
Contributor Author

@yuwu9145 yuwu9145 Mar 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it makes sense.

But falsy value 0 should be excluded as it is also a number

Edit: it was just my personal opinion

@yuwu9145 yuwu9145 requested a review from sxzz March 28, 2023 22:52
@pikax pikax added the ready to merge The PR is ready to be merged. label Oct 20, 2023
@yyx990803 yyx990803 merged commit 17aa92b into vuejs:main Nov 10, 2023
antfu added a commit to vueuse/vueuse that referenced this pull request Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge The PR is ready to be merged.
Projects
Development

Successfully merging this pull request may close these issues.

Undefined is complained when bind :style to an array
4 participants