来升级到 antd@5 吧 #36814
Replies: 32 comments 44 replies
-
antd@4 也需要一个 useToken 来帮助组件库做到互相兼容 具体方案 https://github.com/react-component/util/blob/master/src/hooks/useId.ts#L3 |
Beta Was this translation helpful? Give feedback.
-
如果项目中写了很多的less 变量,项目是无法跑起来的,这里有个兼容方案
删除 less 引用 - @import (reference) '~antd/es/style/themes/index.less';
- @import (reference) '~antd/es/style/mixins/index.less'; 在 umi 中 theme: {
'@ant-prefix': 'ant',
+ ...theme,
'@s-site-menu-width': '258px',
'@root-entry-name': 'variable',
'@border-radius-base': '4px',
'@primary-color': '#1677FF',
'@error-color': '#ff4d4',
'@info-color': '#52c41a',
'@warning-color': '#faad14',
}, 在 webpack 中 {
loader: "less-loader",
options: {
lessOptions: {
javascriptEnabled: true,
+ modifyVars: { ...theme, "@warning-color": "#faad14" },
},
},
}; |
Beta Was this translation helpful? Give feedback.
-
移除 babel-plugin-import 应该算一项。 |
Beta Was this translation helpful? Give feedback.
-
1.next.js 引入直接antd 报错 import { ConfigProvider } from "antd"; 2.ssr 下无法引入 import zhCN from "antd/es/locale/zh_CN"; 都是一些服务端遇到的问题(⊙o⊙)… |
Beta Was this translation helpful? Give feedback.
-
message.warn 的兼容
|
Beta Was this translation helpful? Give feedback.
-
dayjs 升级事项- import moment from 'moment';
+ import dayjs from 'dayjs'; isMoment -> isDayjs- moment.isMoment(text);
+ dayjs.isDayjs(text); fromNow- import moment from 'moment';
- moment(text).fromNow()
+ import dayjs from 'dayjs';
+ import relativeTime from 'dayjs/plugin/relativeTime';
+ dayjs.extend(relativeTime);
+ dayjs(text).fromNow() |
Beta Was this translation helpful? Give feedback.
-
PageHeaderantd 删除了PageHeader,可以从 procomponents 中获取 - import type { PageHeaderProps } from 'antd';
- import { PageHeader } from 'antd';
+ import type { PageHeaderProps } from '@ant-design/pro-components';
+ import { PageHeader } from '@ant-design/pro-components'; |
Beta Was this translation helpful? Give feedback.
-
希望可以看到antd v5的官网,看一看v5到底长什么样子,怎么升级和使用它。 |
Beta Was this translation helpful? Give feedback.
-
哪里能看到antd v5的 changeLog 和 roadMap 呢 |
Beta Was this translation helpful? Give feedback.
-
其他组件中能不能加一个**“伸缩框 ResizeBox”**组件 |
Beta Was this translation helpful? Give feedback.
-
5.0.0-alpha.2 版本的 Popover 组件 overlayInnerStyle 属性设置了没有效果额 |
Beta Was this translation helpful? Give feedback.
-
样式变量( |
Beta Was this translation helpful? Give feedback.
-
Updated figma components for Ant design 5? Any news about it? |
Beta Was this translation helpful? Give feedback.
-
https://ant.design/docs/react/migration-v5-cn 也尝试了将文档中的建议迁移less的方法,配置到UMI4的config.ts中的less loader方法里 是否有在UMI4中使用antd V5的文档?我们已经按照迁移文档要求迁移到antd V4.24.4 |
Beta Was this translation helpful? Give feedback.
-
successfully upgraded👍 |
Beta Was this translation helpful? Give feedback.
-
升级antd 5 在 umi中使配置 AntdMomentWebpackPlugin 后启动不起来了 |
Beta Was this translation helpful? Give feedback.
-
版本 5.1.2 使用watermark组件报错 提示 /node_modules/antd/es/watermark/style/index Does the file exist? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
请大佬们帮忙看一下这个问题: https://github.com/ant-design/ant-design/discussions/40442 |
Beta Was this translation helpful? Give feedback.
-
请问v5用定制主题怎么全局改button的font-weight,我没有找到对应的属性 |
Beta Was this translation helpful? Give feedback.
-
我更新V5后,发现原来的一些样式有变化,影响到我的应用,如V4中有global.less 对HTML的P,h1,h2……h6元素有 margin-top: 0;这个相当于默认的,但在V5没有了,global.less中还有一些东西也可能类似。 |
Beta Was this translation helpful? Give feedback.
-
App包裹组件 |
Beta Was this translation helpful? Give feedback.
-
希望在组件设计时,兼考虑主从、主从从等在一个画面操作的例子,另外定制主题能否有表单上预设的几种,如表头色,内容,奇偶行,选中色等。 |
Beta Was this translation helpful? Give feedback.
-
按照升级文档来的,less,less-loader已经安装了,项目中并没有引入这个less文件,又重新删除了node_moudle包和.umi还是不行 |
Beta Was this translation helpful? Give feedback.
-
CompatibleConsumer.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'Consumer') 按照升级提示从v4升级到v5,浏览器里面有报错 错误文件是 webpack:///node_modules/@ant-design/compatible/es/CompatibleConsumer.js?1b55 错误代码
要怎么解决啊 @chenshuai2144 |
Beta Was this translation helpful? Give feedback.
-
这是来自QQ邮箱的自动回复邮件。您好,您的邮件已经收到,我会在一周内尽快给您回复!
|
Beta Was this translation helpful? Give feedback.
-
这是来自QQ邮箱的自动回复邮件。您好,您的邮件已经收到,我会在一周内尽快给您回复!
|
Beta Was this translation helpful? Give feedback.
-
这里可以写所有升级antd@5 碰到的问题 或者 需求
Beta Was this translation helpful? Give feedback.
All reactions