TypeError: a.slice is not a function - Ant Design's table control

The dataSource of the table should be bound to an array instead of an object! ! !

Insert picture description here

Cause Analysis:

Insert picture description here
The slice method is a method that works on arrays. The data bound here is directly assigned after obtaining res.data from the interface, but res.data is an object, so an error will be reported. Just re-assign to res.data.list in the result set.
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_43361722/article/details/114027697