【问题标题】:Property 'value' does not exist on type 'IDBCursor'类型“IDBCursor”上不存在属性“值”
【发布时间】:2018-09-26 19:35:04
【问题描述】:

似乎typecirpt typings 不知道IDBCursor 接口上的value 属性。

let cursor: IDBCursor;
cursor.value

【问题讨论】:

    标签: typescript indexeddb typescript-typings


    【解决方案1】:

    IDBCursor 接口没有value 属性。你应该使用IDBCursorWithValue interface,它继承自IDBCursor

    这段代码编译没有错误:

    let cursor: IDBCursorWithValue;
    cursor.value;
    

    【讨论】:

      猜你喜欢
      • 2017-06-23
      • 2019-02-17
      • 2017-10-06
      • 2021-05-18
      • 2018-05-13
      • 2021-06-03
      • 1970-01-01
      • 1970-01-01
      • 2021-01-09
      相关资源
      最近更新 更多