react 遍历
1 | res.data.map( |
antd table
1 | const columns |
CROS
1 | Access to XMLHttpRequest at 'http://127.0.0.1:8000/api/imooc/order/' from origin 'http://127.0.0.1:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. |
1 | Origin: http://127.0.0.1:3000 |
1 | pip install django djangorestframework django-cors-headers |
index.js:1375 Warning: Failed prop type: Invalid prop id
of type array
supplied to Select
, expected string
.
expected to return a value in arrow function array-callback-return
A map()
creates an array, so a return
is expected for all code paths (if/elses).
If you don’t want an array or to return data, use forEach
instead.