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

feature: add example type Function to props #114

Merged
merged 2 commits into from
Jun 12, 2020

Conversation

pikax
Copy link
Member

@pikax pikax commented Jun 12, 2020

Just add an example for when the prop type is Function, the behaviour is to treat the default as a function value instead of a factory.

We need to add a better description when we port this: https://vuejs.org/v2/api/#props

Specifies a default value for the prop. If the prop is not passed, this value will be used instead. Object or array defaults must be returned from a factory function.

should be something like:

Specifies a default value for the prop. If the prop is not passed, this value will be used instead. If prop type is a function default will be used as value instead of factory function. Object or array defaults must be returned from a factory function.

vue-next PR with change: vuejs/core#1349

@pikax pikax requested a review from NataliaTepluhina June 12, 2020 15:15
Copy link
Member

@NataliaTepluhina NataliaTepluhina left a comment

Choose a reason for hiding this comment

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

@pikax thank you for this addition! I've suggested a slight change to comments but it's completely up to you 😅

src/guide/component-props.md Outdated Show resolved Hide resolved
src/guide/component-props.md Show resolved Hide resolved
Co-authored-by: Natalia Tepluhina <tarya.se@gmail.com>
@pikax
Copy link
Member Author

pikax commented Jun 12, 2020

Much better 🙏

@NataliaTepluhina
Copy link
Member

@pikax yay! Happy to merge 🎉

@NataliaTepluhina NataliaTepluhina merged commit f80fa6b into master Jun 12, 2020
@pikax pikax deleted the feat/prop_type_function_value branch June 12, 2020 15:28
TalexDreamSoul pushed a commit to Talexs/docs that referenced this pull request Apr 17, 2022
* docs: review async.md

* Apply suggestions from code review

Co-authored-by: wxsm <wxsms@foxmail.com>

* Apply suggestions from code review

Co-authored-by: JohnieXu <281910378@qq.com>

* chore: apply some suggestions and update translations

* chore: update

Co-authored-by: wxsm <wxsms@foxmail.com>
Co-authored-by: JohnieXu <281910378@qq.com>
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.

2 participants