4
我最近更新了我的角應用到4.0以利用路由之間的動畫。角路由器動畫計時錯誤
下面是我的動畫功能:
export function routerTransition() {
return trigger('routerAnimations', [
transition('home => development, design => home', [
query(':enter, :leave', style({ position: 'absolute', top: 0, left: 0, right: 0 })),
query(':leave', style({ zIndex: 100 })),
query(':enter', style({ transform: 'translateX(100%)', opacity:1 })),
group([
query(':leave', group([
animate('0.7s cubic-bezier(0.68, -0.75, 0.265, 1.55)', style({ transform: 'translateX(-100%)', opacity:0 }))
])),
query(':enter', group([
animate('0.7s cubic-bezier(0.68, -0.75, 0.265, 1.55)', style({ transform: 'translateX(0%)' }))
]))
])
]),
transition('home => design, development => home', [
query(':enter, :leave', style({ position: 'absolute', top: 0, left: 0, right: 0 })),
query(':leave', style({ zIndex: 100 })),
query(':enter', style({ transform: 'translateX(-100%)', opacity:1 })),
group([
query(':leave', group([
animate('0.8s cubic-bezier(0.68, -0.75, 0.265, 1.55)', style({ transform: 'translateX(100%)', opacity:0 }))
])),
query(':enter', group([
animate('0.8s cubic-bezier(0.68, -0.75, 0.265, 1.55)', style({ transform: 'translateX(0%)' }))
]))
])
])
])
}
出於某種原因,當我改變一個過渡的時間是一樣的其他(即變「0.7秒」到「0.8秒」)我得到以下錯誤:
The CSS property "transform" that exists between the times of "0ms" and "800ms" is also being animated in a parallel animation between the times of "0ms" and "800ms"
的兩個動畫不應作爲stateChangeExpr
重疊爲每個轉變不同。
我錯過了什麼?
感謝您的幫助,這對我很有用。 – adamjesmith