Skip to content

Commit 7a6e53b

Browse files
committed
Update options props
1 parent 65cbf74 commit 7a6e53b

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)