File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -140,10 +140,10 @@ var vm = new Vue({
140
140
})
141
141
```
142
142
143
- ## Annotating Return Type
143
+ ## Annotating Return Types
144
144
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 ` .
147
147
148
148
``` ts
149
149
import Vue , { VNode } from ' vue'
@@ -173,4 +173,5 @@ const Component = Vue.extend({
173
173
})
174
174
```
175
175
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.
You can’t perform that action at this time.
0 commit comments