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(runtime-core): merge return value when there is undefined value in withDefaults #7646

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

godxiaoji
Copy link
Contributor

From #7619, increase the judgment of undefined value in withDefaults.

At the same time, according to the requirements of the document, ensures the returned props type has the optional flags removed for properties.

const res = withDefaults(
  defineProps<{
    str?: string;
    bool: boolean;
  }>(),
  {
    str: undefined,
    bool: undefined
  }
);

// res.str: string | undefined
// res.bool: boolean | undefined

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.

None yet

1 participant