Skip to content

Commit

Permalink
clarify value of this for arrow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvfritz committed Apr 1, 2018
1 parent afc3d30 commit 3755a20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/v2/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ type: api
})
```

Note that if you use an arrow function with the `data` property, `this` will be undefined, but you can still access the instance as the function's first argument:
Note that if you use an arrow function with the `data` property, `this` won't be the component's instance, but you can still access the instance as the function's first argument:

```js
data: vm => ({ a: vm.myProp })
Expand Down Expand Up @@ -537,7 +537,7 @@ type: api

Computed properties to be mixed into the Vue instance. All getters and setters have their `this` context automatically bound to the Vue instance.

Note that if you use an arrow function with a computed property, `this` will be undefined, but you can still access the instance as the function's first argument:
Note that if you use an arrow function with a computed property, `this` won't be the component's instance, but you can still access the instance as the function's first argument:

```js
computed: {
Expand Down

0 comments on commit 3755a20

Please sign in to comment.