You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you find type inference or member completion isn't working, annotating certain methods may help address these problems. Using the `--noImplicitAny` option will help find many of these unannotated methods.
190
+
191
+
192
+
193
+
## Annotating Props
194
+
195
+
```ts
196
+
importVue, { PropType } from'vue'
197
+
198
+
interfaceComplexMessage {
199
+
title:string,
200
+
okMessage:string,
201
+
cancelMessage:string
202
+
}
203
+
const Component =Vue.extend({
204
+
props: {
205
+
name: String,
206
+
success: { type: String },
207
+
callback: {
208
+
type: FunctionasPropType<() =>void>
209
+
},
210
+
message: {
211
+
type: ObjectasPropType<ComplexMessage>,
212
+
required: true,
213
+
validator (message:ComplexMessage) {
214
+
return!!message.title;
215
+
}
216
+
}
217
+
}
218
+
})
219
+
```
220
+
If you find validator not getting type inference or member completion isn't working, annotating the argument with the expected type may help address these problems.
0 commit comments