Antd - Warning: [antd: Modal] Modal.config is deprecated. Please use ConfigProvider.config instead.

antd报错

Warning: [antd: Modal] Modal.config is deprecated. Please use ConfigProvider.config instead.
Antd - Warning: [antd: Modal] Modal.config is deprecated. Please use ConfigProvider.config instead.

原因

版本更新导致不支持,如报错内容

解决

使用 ConfigProvider.config 代替 Modal.config
且属性 rootPrefixCls 更新为 prefixCls

Antd - Warning: [antd: Modal] Modal.config is deprecated. Please use ConfigProvider.config instead.

//old
Modal.config({
  rootPrefixCls: 'xxx',
})
//new
ConfigProvider.config({
  prefixCls: 'xxx',
});
上一篇:antD vue 复选框多选选中


下一篇:【leetcode】日积月累,每日一题--26. 删除有序数组中的重复项(DayDayUp 11)