interfaceTest{imgNumberPerWork:numberdisplayCover:boolean}consttest:Test={imgNumberPerWork:0,displayCover:true}functionsetValue(key:keyofTest,val:any){test[key]=val}setValue('imgNumberPerWork',1)函数setValue里的test[key]报错了,不能将类型“any”分配给类型“never”。请问如何理解这里呢?
DIEA
相关分类