From 3cd2569f2f06a4ab244f87545ca93fd904012765 Mon Sep 17 00:00:00 2001 From: ktsn Date: Sat, 21 Oct 2017 23:07:51 +0900 Subject: [PATCH] Add a note about `this` type inference --- src/v2/guide/typescript.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/v2/guide/typescript.md b/src/v2/guide/typescript.md index e7d9b61f00..2cfc80082d 100644 --- a/src/v2/guide/typescript.md +++ b/src/v2/guide/typescript.md @@ -31,6 +31,8 @@ We also plan to provide an option to scaffold a ready-to-go Vue + TypeScript pro } ``` +Note that you have to include `strict: true` (or at least `noImplicitThis: true` which is a part of `strict` flag) to leverage type checking of `this` in component methods otherwise it is always treated as `any` type. + See [TypeScript compiler options docs](https://www.typescriptlang.org/docs/handbook/compiler-options.html) for more details. ## Development Tooling