angular 2 ngIf and CSS transition/animation

前端 未结 7 1771
予麋鹿
予麋鹿 2020-11-29 16:23

I want a div to slide in from the right in angular 2 using css.

  

7条回答
  •  感动是毒
    2020-11-29 16:44

        trigger('slideIn', [
          state('*', style({ 'overflow-y': 'hidden' })),
          state('void', style({ 'overflow-y': 'hidden' })),
          transition('* => void', [
            style({ height: '*' }),
            animate(250, style({ height: 0 }))
          ]),
          transition('void => *', [
            style({ height: '0' }),
            animate(250, style({ height: '*' }))
          ])
        ])
    

提交回复
热议问题