-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Doc EN : props
vs "props" in passing-props
for better comprehension.
#1597
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
Conversation
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
Differetiate usage of `props` to speak about `props` options and "props" to speak about the props concept. Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
docs/en/essentials/passing-props.md
Outdated
@@ -59,7 +58,7 @@ const router = new VueRouter({ | |||
|
|||
### Function mode | |||
|
|||
You can create a function that returns props. This allows you to cast the parameter to another type, combine static values with route-based values, etc. | |||
You can create a function that returns props. This allows you to coerce the parameter to another type, combine static values with route-based values, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can coerce to other values, but here we still want to keep cast
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tl;dr => It's ok to merge like that for me :)
But
I'm not sure to well understand difference between « cast » and « coerce » :D
For me, « cast » is the action to explicitly convert a type value into another with some keyword usage.
And « coerce » is the action to implicitly convert a type value with the usage of a context or operand.
You means « with the usage of operand » is not "coercing" but is "casting" too? Even the conversion is « implicite » (no « int » or « string » keyword for example)?
Or I not understand the action behind « This allows you to cast the parameter to another type ».
So in JavaScript you coerce, in C# you cast (same for TypeScript no?)
Use coerce word in replacement of cast — « In computer science, type conversion, type casting, and type coercion are different ways of changing an entity of one data type into another. » JavaScript use coercion, not casting : https://en.wikipedia.org/wiki/Type_conversion
Better readibility between "props" as a concept and
props
as the option.That is not totaly clear for me so feel free to correct that if I do mistake on some occurences.