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: do not render class when it is undefined or null #9199

Closed
wants to merge 1 commit into from
Closed

fix: do not render class when it is undefined or null #9199

wants to merge 1 commit into from

Conversation

evanryuu
Copy link

This PR is related to #3173.

Since normalizeStyle method can return undefined, I was just thinking why not make normalizeClass also able to return undefined? In my personal opinion, this seems more consistent.

With this PR, the props in the example in #3173 should be rendered consistently as below:

string
image
undefined
image
null
image

@baiwusanyu-c
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Sep 12, 2023

📝 Ran ecosystem CI: Open

suite result latest scheduled
nuxt success success
pinia success success
quasar success failure
router success success
test-utils success success
vant failure success
vite-plugin-vue success success
vitepress success success
vue-i18n success success
vue-macros failure failure
vuetify success success
vueuse success success
vue-simple-compiler success success

@baiwusanyu-c
Copy link
Member

LGTM, but there seems to be a bit of a ‘breaking change’

@evanryuu
Copy link
Author

LGTM, but there seems to be a bit of a ‘breaking change’

Thank you for your reply!

I looked into the failed tests, and I can't quite figure out why this PR caused the tests to fail😇 My apologies.

@gokaybiz
Copy link

For Vant, it probably fails because of the data type here.
https://github.com/youzan/vant/blob/fae9a236e2d17bef63ab76527cdd5dc3309cb154/packages/vant/src/tab/Tab.tsx#L96

@evanryuu
Copy link
Author

For Vant, it probably fails because of the data type here. youzan/vant@fae9a23/packages/vant/src/tab/Tab.tsx#L96

Thank you! It does look like Vant relies on normalizeClass returning string only.

@evanryuu evanryuu closed this by deleting the head repository Feb 22, 2024
@evanryuu
Copy link
Author

I didn't realize I accidentally deleted the source repo until now. Apologies for my mistakes☹️ But I also believe there could be better solutions. Hope someone else could solve this more elegantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

4 participants