我在Angular中使用httpClient从JSON占位符获取一些模拟数据。它在我的控制台中显示为一个对象数组,但是Visual Studio Code错误表明它是一个对象。错误显示“type Object is not assignable to any[]”。这里的问题是什么?table-layout.component.ts import { BrowserModule } from '@angular/platform-browser'
import { Component, OnInit, NgMo
/> );但是它会返回一条错误消息,并且不会编译:
error TS2322: Type '({children, title, icon, kind}: { children: any; title: any; icon: any; kind: any; }) => Element[]' is not assignable to type 'StatelessComponent<PropsType 'Element[]' i