[RFC] ConfigProvider support animation={false}
#40040
afc163
announced in
RFCs - archive
Replies: 3 comments 2 replies
-
补充一个 Motivation
对应的 API 的想法按维度开关:比如 Wave 和 Modal 的展开收起是否可以分别开关。 |
Beta Was this translation helpful? Give feedback.
0 replies
-
token的覆盖应该用 import { ConfigProvider } from 'antd';
export default () => (
<ConfigProvider theme={{
token: {
motionUnit: 0,
},
}}>
...
</ConfigProvider>
) fast、mid、slow都是基于unit派生的: {
// motion
motionDurationFast: `${(motionBase + motionUnit).toFixed(1)}s`,
motionDurationMid: `${(motionBase + motionUnit * 2).toFixed(1)}s`,
motionDurationSlow: `${(motionBase + motionUnit * 3).toFixed(1)}s`,
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
@afc163 @zombieJ @MadCcc 最近在开发中遇到了一个问题,使用 motionUnit =0.001 无法解决。 测试了 CodeSandbox,是正常的:https://codesandbox.io/s/modal-qu-dong-hua-gong-neng-np6h6q?file=/demo.tsx:0-195 但如果使用 nextjs,则会有问题(点两次就能复现):https://codesandbox.io/p/sandbox/proud-sun-dbhceq |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
概况
ConfigProvider 新增
animation
属性,用于开启/关闭所有组件的动画效果。Motivation
参考 https://ng.ant.design/docs/animations/zh 可以全局关闭组件动画效果。
API
ConfigProvider
Basic Example
Detailed
Drawbacks
需要修改有动画的组件实现,有一定侵入性。
Other solutions
下面这个也是个可行方案,而且无需开发现在就能用,不过要检查一下能不能覆盖所有动画效果。
Beta Was this translation helpful? Give feedback.
All reactions