antd-pro

Tantd-pro项目问题

antd-pro项目开发问题

antd-pro项目开发中遇到的控制台报错问题。

  1. Warning: Cannot update a component (ForwardRef(TableModule)) while rendering a different component (Cell). To locate the bad setState() call inside Cell, follow the stack trace as described in https://fb.me/setstate-in-render
    in Cell (created by BodyRow);

    原因:表头操作项使用了useState操作
    示例:
    在这里插入图片描述

  2. index.js:1 Warning: Each child in a list should have a unique “key” prop. See https://fb.me/react-warning-keys for more information. in tbody (created by Body)

    原因:table 唯一key值,操作项需加key,涉及循环的都需要加key,只在最外层标签起作用
    示例:
    在这里插入图片描述

  3. 滚动页面,下拉框会滚动至页面上方
    示例
    在这里插入图片描述
    解决方法:
    为组件添加属性
    getPopupContainer={triggerNode => triggerNode.parentNode}
    时间选择器需要添加
    getCalendarContainer={triggerNode => triggerNode.parentNode}

  4. 文件上传格式限制
    示例:
    beforeUpload(file) {
    return new Promise(function (resolve, reject) {
    if (file.type !== “application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”) {
    message.error(请选择样本模板且只允许上传.xlsx文件!)
    reject()
    } else {
    resolve()
    }
    })
    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值