typescript7053报错
问题
TS7053: Element implicitly has an ‘any’ type because expression of type ‘string number’ can’t be used to index type 't"
No index signature with a parameter of type ‘string’ was found on typ
解决:
let obj:Record<string, any> = {}
this.columnList.forEach((p: { prop: string | number; }) => obj[p.prop] = '')
问题:
TS7006: Parameter ‘p’ implicitly has an ‘any’ type.
解决:
let obj:Record<string, any> = {}
this.columnList.forEach((p: { prop: string | number; }) => obj[p.prop] = '')
问题:
解决:
let index:number = this.curTarget.colIdx;
let list : any =this.columnList;
return list[index]??{}