File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -432,23 +432,25 @@ export class ElementController {
432
432
new Ctor ( {
433
433
id,
434
434
context : this . context ,
435
- style : {
436
- ...style ,
437
- } ,
435
+ style,
438
436
} ) ,
439
437
) as Element ;
440
438
441
439
this . shapeTypeMap [ id ] = type ;
442
440
this . elementMap [ id ] = element ;
443
441
444
- const { stage = 'enter' } = context ;
442
+ const { stage = 'enter' , animation } = context ;
443
+
444
+ const enableAnimation = animation && this . context . options . animation ;
445
445
446
446
this . context . animation ?. add (
447
447
{
448
448
element,
449
449
elementType,
450
450
stage,
451
- originalStyle : { ...element . attributes } ,
451
+ // <zh/> 当关闭动画时,不需要深拷贝样式
452
+ // <en/> When the animation is turned off, there is no need to deep copy the style
453
+ originalStyle : enableAnimation ? { ...element . attributes } : element . attributes ,
452
454
updatedStyle : style ,
453
455
} ,
454
456
{
Original file line number Diff line number Diff line change 4
4
* <en/> Theme Options
5
5
* @public
6
6
*/
7
- export type ThemeOptions = 'light' | 'dark' | string ;
7
+ export type ThemeOptions = false | 'light' | 'dark' | string ;
Original file line number Diff line number Diff line change @@ -189,12 +189,12 @@ export function getElementAnimationOptions(
189
189
localAnimation ?: AnimationEffectTiming | boolean ,
190
190
) : STDAnimation {
191
191
const { animation : globalAnimation } = options ;
192
+ if ( globalAnimation === false || localAnimation === false ) return [ ] ;
192
193
193
194
const userElementAnimation = options ?. [ elementType ] ?. animation ;
194
195
if ( userElementAnimation === false ) return [ ] ;
195
196
const useElementStageAnimation = userElementAnimation ?. [ stage ] ;
196
197
if ( useElementStageAnimation === false ) return [ ] ;
197
- if ( globalAnimation === false || localAnimation === false ) return [ ] ;
198
198
199
199
// 优先级:用户局部动画配置 > 用户动画配置 > 全局动画配置 > 主题动画配置 > 默认动画配置
200
200
// Priority: user local animation configuration > user animation configuration > global animation configuration > theme animation configuration > default animation configuration
You can’t perform that action at this time.
0 commit comments