From 1f16a53d96723e8137b3e6fd3bb9f1e47f920f03 Mon Sep 17 00:00:00 2001 From: Alexander Sokolov Date: Thu, 20 Jul 2017 21:32:57 +0300 Subject: [PATCH] Update index.md --- src/v2/api/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index ac10d7249c..8892dc6e8b 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -705,7 +705,7 @@ if (version === 2) { ## Options / Lifecycle Hooks -All lifecycle hooks automatically have their `this` context bound to the instance, so that you can access data, computed properties, and methods. This means __you should not use an arrow function to define a lifecycle method__ (e.g. `created: () => this.fetchTodos()`). The reason is arrow functions bind the parent context, so `this` will not be the Vue instance as you expect and `this.fetchTodos` will be undefined. +

All lifecycle hooks automatically have their `this` context bound to the instance, so that you can access data, computed properties, and methods. This means __you should not use an arrow function to define a lifecycle method__ (e.g. `created: () => this.fetchTodos()`). The reason is arrow functions bind the parent context, so `this` will not be the Vue instance as you expect and `this.fetchTodos` will be undefined.

### beforeCreate