group

定义一个可以并行运行的动画步骤列表。

Defines a list of animation steps to be run in parallel.

      
      group(steps: AnimationMetadata[], options: AnimationOptions = null): AnimationGroupMetadata
    
参数
steps AnimationMetadata[]

一个由动画步骤对象构成的数组。

An array of animation step objects.

  • 当步骤由 style()animate() 的函数调用定义时,组中的每个调用都会立即执行。

    When steps are defined by style() or animate() function calls, each call within the group is executed instantly.

  • 要指定供带有延迟的偏移样式,请使用 keyframes() 调用来定义步骤;如果要指定延迟的时长,则改用 animate() 调用。

    To specify offset styles to be applied at a later time, define steps with keyframes(), or use animate() calls with a delay value.

例如:

For example:

group([ animate("1s", { background: "black" })) animate("2s", { color: "white" })) ])
      
      group([
  animate("1s", { background: "black" }))
  animate("2s", { color: "white" }))
])
    
options AnimationOptions

一个配置对象,包含一个延迟和一些由开发人员定义的参数,这些参数用于提供样式的默认值,并可在调用时重写。

An options object containing a delay and developer-defined parameters that provide styling defaults and can be overridden on invocation.

可选. 默认值是 null.

返回值

一个封装了该组数据的对象。

AnimationGroupMetadata: An object that encapsulates the group data.

使用说明

当一系列样式分别需要在不同的起始时间开始动画并在不同的结束时间停止时,分组动画非常有用。

Grouped animations are useful when a series of styles must be animated at different starting times and closed off at different ending times.

当在 sequence()transition() 中调用它时,除非完成所有内部动画步骤,否则不会执行后续步骤。

When called within a sequence() or a transition() call, does not continue to the next instruction until all of the inner animation steps have completed.