Skip to content

Commit 5130833

Browse files
make explanation more clear, thank @daniel!
1 parent e95fd6a commit 5130833

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/v2/guide/typescript.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ var vm = new Vue({
142142

143143
## Annotating Return Type
144144

145-
Vue's type definition is prone to [circular reference](https://github.com/Microsoft/TypeScript/issues/12846#issuecomment-270296195) of `this`.
146-
Annotating return type is highly recommended to avoid such error.
145+
Because of the circular nature of Vue's declaration files, TypeScript may have difficulties inferring the types of certain methods.
146+
For this reason, you may need to annotate the return type on methods like `render` and those in `computed`.
147147

148148
```ts
149149
import Vue, { VNode } from 'vue'
@@ -173,4 +173,5 @@ const Component = Vue.extend({
173173
})
174174
```
175175

176-
If you find type inference or member completion doesn't work, you can try annotating method return type.
176+
If you find type inference or member completion isn't working, annotating certain methods may help address these problems.
177+
Using the `--noImplicitAny` option will help find many of these unannotated methods.

0 commit comments

Comments
 (0)