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',
  },
};

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM