Skip to content

Commit 4dd36de

Browse files
committed
PropsData reviewed
1 parent ad60e93 commit 4dd36de

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/api/index.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,3 +373,30 @@ type: api
373373
```
374374

375375
- **See also:** [Props](/guide/components.html#Props)
376+
377+
### propsData
378+
379+
> 1.0.22+
380+
381+
- **Type:** `Object`
382+
383+
- **Restriction:** only respected in instance creation via `new`.
384+
385+
- **Details:**
386+
387+
Pass props to an instance during its creation. This is primarily intended to make unit testing easier.
388+
389+
- **Example:**
390+
391+
``` js
392+
var Comp = Vue.extend({
393+
props: ['msg'],
394+
template: '<div>{{ msg }}</div>'
395+
})
396+
397+
var vm = new Comp({
398+
propsData: {
399+
msg: 'hello'
400+
}
401+
})
402+
```

0 commit comments

Comments
 (0)