【发布时间】:2018-10-11 14:06:45
【问题描述】:
在严格模式下使用 webix(5.4.0) + typescript(3.1.1) 时遇到问题 TS2683。
($$('DATE') as webix.ui.datepicker)attachEvent('onChange', function() {
let val:any = this.getValue() // or let val = ... without any
// this:this??? () = > not suit for me, btw
...
}
错误是:
'this' implicity has type 'any' because it doesn't have a type annotation.
我读过How to access the correct `this` inside a callback? 但看起来,一切都是关于处理外部这个,而且我需要声明内部这个类型。那我该怎么办?
【问题讨论】:
标签: typescript strict webix