填寫這份《一分鐘調查》,幫我們(開發組)做得更好!去填寫Home

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", style({ background: "black" })),
  animate("2s", style({ 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.