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

feat: syntax compatibility #5

Merged

Conversation

DDDDD12138
Copy link
Contributor

fix: #4

Description

Vue 3.5+ supports Reactive Props Destructure.

Given that the TranslationStatus component is sourced directly and needs to be compatible with multiple Vue 3 versions, this PR ensures compatibility with both Vue 3.0+ and Vue 3.5+.

@Jinjiang
Copy link
Member

Thanks for the PR. I think we still need to support the versions below v3.5.x. So withDefaults() is still necessary but in another way like here: https://vuejs.org/api/sfc-script-setup.html#default-props-values-when-using-type-declaration

@Jinjiang
Copy link
Member

... and it would be appreciated if you can further provide a reproduction with that warning.

@DDDDD12138
Copy link
Contributor Author

I initially discovered it from vuejs/test-utils#2548, and its Vue version has already reached 3.5+.

@DDDDD12138
Copy link
Contributor Author

I did not use TS declarations to specify the default value of the prop; I used the basic default in Prop Validation. It seems to solve this issue?

@Jinjiang Jinjiang merged commit bca2846 into vuejs-translations:main Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

warning: withDefaults() is unnecessary when using destructure with defineProps()
2 participants