Skip to content

Commit c0fe2e2

Browse files
committed
clarify naming in counter event components example, fixes vuejs#1051
1 parent 1d1e2a5 commit c0fe2e2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/v2/guide/components.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,14 +501,14 @@ Here's an example:
501501

502502
``` js
503503
Vue.component('button-counter', {
504-
template: '<button v-on:click="increment">{{ counter }}</button>',
504+
template: '<button v-on:click="incrementCounter">{{ counter }}</button>',
505505
data: function () {
506506
return {
507507
counter: 0
508508
}
509509
},
510510
methods: {
511-
increment: function () {
511+
incrementCounter: function () {
512512
this.counter += 1
513513
this.$emit('increment')
514514
}
@@ -536,14 +536,14 @@ new Vue({
536536
</div>
537537
<script>
538538
Vue.component('button-counter', {
539-
template: '<button v-on:click="increment">{{ counter }}</button>',
539+
template: '<button v-on:click="incrementCounter">{{ counter }}</button>',
540540
data: function () {
541541
return {
542542
counter: 0
543543
}
544544
},
545545
methods: {
546-
increment: function () {
546+
incrementCounter: function () {
547547
this.counter += 1
548548
this.$emit('increment')
549549
}

0 commit comments

Comments
 (0)