Skip to content

Commit 58c4b95

Browse files
committed
update new features for 1.0.22
1 parent 18ad27e commit 58c4b95

File tree

1 file changed

+52
-1
lines changed

1 file changed

+52
-1
lines changed

src/api/index.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,33 @@ type: api
434434

435435
- **See also:** [Props](/guide/components.html#Props)
436436

437+
### propsData
438+
439+
> 1.0.22+
440+
441+
- **Type:** `Object`
442+
443+
- **Restriction:** only respected in instance creation via `new`.
444+
445+
- **Details:**
446+
447+
Pass props to an instance during its creation. This is primarily intended to make unit testing easier.
448+
449+
- **Example:**
450+
451+
``` js
452+
var Comp = Vue.extend({
453+
props: ['msg'],
454+
template: '<div>{{ msg }}</div>'
455+
})
456+
457+
var vm = new Comp({
458+
propsData: {
459+
msg: 'hello'
460+
}
461+
})
462+
```
463+
437464
### computed
438465

439466
- **Type:** `Object`
@@ -885,6 +912,30 @@ type: api
885912
console.log(vm) // -> StackOverflow {$el: null, ...}
886913
```
887914

915+
### extends
916+
917+
> 1.0.22+
918+
919+
- **Type:** `Object | Function`
920+
921+
- **Details:**
922+
923+
Allows declaratively extending another component (could be either a plain options object or a constructor) without having to use `Vue.extend`. This is primarily intended to make it easier to extend between single file components.
924+
925+
This is similar to `mixins`, the difference being that the component's own options takes higher priority than the source component being extended.
926+
927+
- **Example:**
928+
929+
``` js
930+
var CompA = { ... }
931+
932+
// extend CompA without having to call Vue.extend on either
933+
var CompB = {
934+
extends: CompA,
935+
...
936+
}
937+
```
938+
888939
## Instance Properties
889940

890941
### vm.$data
@@ -1900,7 +1951,7 @@ type: api
19001951

19011952
- **Arguments:**
19021953
- `{String} [symbol] - default: '$'`
1903-
- `{Number} [decimal places] - default: 2`
1954+
- **1.0.22+** `{Number} [decimal places] - default: 2`
19041955

19051956
- **Example:**
19061957

0 commit comments

Comments
 (0)