且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

组件未从服务接收数据

更新时间:2023-01-24 07:47:51

在您的服务,您应该返回值:

At your service, you should return the value:

     .then(response => {
         console.log(response.json());
         return response.json() as Project[];
     })

此隐式的箭头返回函数仅在语句没有大括号时才起作用.即:

This implicit return on arrow functions only works when the statement doesn't have curly braces. i.e:

     .then(response => response.json() as Project[])