记录typeScript学习

54 阅读1分钟

Try to answer "Why type-checking is disabled here?"

handleDateSelected: debounce<Methods['handleDateSelected']>(function (e) {
  const date = e.detail.value;

  // @ts-ignore
  if (date === this.data.selectedDate) {
    return;
  }

  // @ts-ignore
  this.getDailyBrushingRecordsAndStat(date).then(() => {
    // @ts-ignore
    this.setData({
      selectedDate: date,
      showBrushingDetail: true,
    });
  });
}, 300),

22.png

参考资料:stackoverflow.com/questions/5…