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

Add Prop.type: Function behavior #113

Closed
pikax opened this issue Jun 12, 2020 · 1 comment
Closed

Add Prop.type: Function behavior #113

pikax opened this issue Jun 12, 2020 · 1 comment

Comments

@pikax
Copy link
Member

pikax commented Jun 12, 2020

When the prop has the type of Function, the default is treated as a value instead of factory:
https://github.com/vuejs/docs-next/blob/master/src/guide/component-props.md#prop-validation

    // Type function, the default will be the default function
    propG: {
      type: Function,
      default: function () {
        return 'Default function'
      },
    },

PR with the change vuejs/core#1349

@NataliaTepluhina
Copy link
Member

Closing as related PR was merged 🎉

TalexDreamSoul pushed a commit to Talexs/docs that referenced this issue Apr 17, 2022
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

No branches or pull requests

2 participants