Skip to content

Commit 7824034

Browse files
committed
Merge remote-tracking branch 'upstream/master'
# Conflicts: # src/v2/guide/list.md
2 parents 340fcb5 + aa95bf2 commit 7824034

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

src/v2/api/index.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,34 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
948948
}
949949
```
950950
951+
> The next 2 examples only work with Vue > 2.2.1. Below that version, injected values were resolved after the `props` and the `data` initialization.
952+
953+
Using an injected value as the default for a prop:
954+
```js
955+
const Child = {
956+
inject: ['foo'],
957+
props: {
958+
bar: {
959+
default () {
960+
return this.foo
961+
}
962+
}
963+
}
964+
}
965+
```
966+
967+
Using an injected value as data entry:
968+
```js
969+
const Child = {
970+
inject: ['foo'],
971+
data () {
972+
return {
973+
bar: this.foo
974+
}
975+
}
976+
}
977+
```
978+
951979
## Options / Misc
952980
953981
### name

src/v2/guide/components.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ new Vue({
327327
</script>
328328
{% endraw %}
329329

330-
### Literal vs Dynamic
330+
### Literal vs. Dynamic
331331

332332
A common mistake beginners tend to make is attempting to pass down a number using the literal syntax:
333333

@@ -508,7 +508,7 @@ Vue.component('button-counter', {
508508
this.counter += 1
509509
this.$emit('increment')
510510
}
511-
},
511+
}
512512
})
513513
new Vue({
514514
el: '#counter-event-example',

src/v2/guide/list.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ Cependant, cela ne passera pas automatiquement les données au composant parce q
229229
<my-component
230230
v-for="(item, index) in items"
231231
v-bind:item="item"
232-
v-bind:index="index">
232+
v-bind:index="index"
233+
v-bind:key="item.id">
233234
</my-component>
234235
```
235236

0 commit comments

Comments
 (0)