antd4.0 踩坑记录

Table组件的dataSource

表现:报错,warning,缺少key。

解决方案:数据处理增加key值即可

例如在model的reducer里

    codeList: list.map(v => {
          v.key = v.id
          return v
        }),

 ESLint的报错 error Identifier '' is not in camel case @typescript-eslint/camelcase

现象描述:后端传递给前端的字符不一定是标准的驼峰,有时是下划线,所以有时候会过不了lint检测

解决方案:添加自己的规则

//  .eslintrc.js
module.exports = {
  extends: [require.resolve('@umijs/fabric/dist/eslint')],
  globals: {
    ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
    page: true,
    REACT_APP_ENV: true,
  },
  rules: {
    '@typescript-eslint/camelcase': 'off',
  },
};

 

posted @ 2020-05-15 16:50  千枫漓音  阅读(1045)  评论(0编辑  收藏  举报