Skip to content

Update props API doc #81

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

Merged
merged 1 commit into from
Jun 17, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions source/api/options.md
Original file line number Diff line number Diff line change
@@ -130,6 +130,26 @@ For passing data more details see the following:
- [Prop Binding Types](/guide/components.html#Prop_Binding_Types)
- [Passing Callbacks as Props](/guide/components.html#Passing_Callbacks_as_Props)

Instead of defining the props as strings, you can use Objects that contain validation requirements:

``` js
Vue.component('prop-validation-demo', {
props: [
{
name: 'size',
type: Number
},
{
name: 'message',
type: String,
required: true
}
]
})
```

For prop validation more details see [Prop Validation](/guide/components.html#Prop_Validation).

#### Notes on hyphened attributes

HTML attribute names ignore upper and lower case differences, so we usually use hyphened attributes instead of camel case. There are some special cases when using `props` with attributes that contains hyphens: