Skip to content

Commit dd192ad

Browse files
committed
Merge pull request #81 from vuejs-jp/fix/api/props
Update props API doc
2 parents dcdbc33 + 7a6e53b commit dd192ad

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

source/api/options.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,26 @@ For passing data more details see the following:
130130
- [Prop Binding Types](/guide/components.html#Prop_Binding_Types)
131131
- [Passing Callbacks as Props](/guide/components.html#Passing_Callbacks_as_Props)
132132

133+
Instead of defining the props as strings, you can use Objects that contain validation requirements:
134+
135+
``` js
136+
Vue.component('prop-validation-demo', {
137+
props: [
138+
{
139+
name: 'size',
140+
type: Number
141+
},
142+
{
143+
name: 'message',
144+
type: String,
145+
required: true
146+
}
147+
]
148+
})
149+
```
150+
151+
For prop validation more details see [Prop Validation](/guide/components.html#Prop_Validation).
152+
133153
#### Notes on hyphened attributes
134154

135155
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:

0 commit comments

Comments
 (0)