实战 ant design pro 中的坑

1.前戏:

1,替换mock数据:

1.将:.roadhogrc.mock.js 中的代理模式替换
当不使用代理的时候就会将所有 /api/*的链接换成 http://localhost:8080/
export default noProxy ? {'GET /api/*':'http://localhost:8080/'} : delay(proxy, 1000);
2.启动: 
window:npm run start:no-proxy
其他系统没试

1.不能翻页 。 what?这是什么鬼没设置key?翻了下案例也没找到key在哪里,https://gist.github.com/xgqfrms-gildata/36be904c705bfe4952122b6d2e63357c 。擦,表格data必须设置key属性。

将服务端返回id改成key。

Warning: Each record in dataSource of table should have a unique `key` prop, or set `rowKey` to an unique primary key,see https://u.ant.design/table-row-key
index.js:2177
Warning: Each record in table should have a unique `key` prop,or set `rowKey` to an unique primary key.

猜你喜欢

转载自www.cnblogs.com/subtract/p/8978160.html