Angular 2动画“无法在’Element’上执行’animate’:不支持部
发布时间:2020-12-17 10:24:31 所属栏目:安全 来源:网络整理
导读:我创建了以下Angular 2动画: trigger('detailsContentAnimation',[ state('1',style( { 'height': '*','padding-top': '*','padding-bottom': '*' })),state('0',style( { 'height': 0,'padding-top': 0,'padding-bottom': 0 })),transition('* = *',animat
我创建了以下Angular 2动画:
trigger('detailsContentAnimation',[ state('1',style( { 'height': '*','padding-top': '*','padding-bottom': '*' })),state('0',style( { 'height': 0,'padding-top': 0,'padding-bottom': 0 })),transition('* => *',animate('400ms ease-out')) ]) 此动画应滑入/滑出以下HTML内容: <div> <div class="col-card__content-div"> <div [@detailsContentAnimation]="areDetailsVisible" class="card-block"> <ng-content select=".col-card__contentselector--body"></ng-content> </div> </div> 当动画发生时,我收到以下错误:
为什么会发生这种情况,我该如何解决?
基于提供的代码,这似乎对我有用(在Chrome 59.0.3,Firefox 54.0.1和Safari 9中测试,全部在Mac上).
请参阅此 minimal example on Github,即 running live here.以下是使用您的代码的 card component和 card template的直接链接.我尝试但无法重现您的错误. 我的版本: "@angular/animations": "^4.3.1","@angular/common": "^4.0.0","@angular/compiler": "^4.0.0","@angular/core": "^4.0.0","@angular/forms": "^4.0.0","@angular/http": "^4.0.0","@angular/platform-browser": "^4.0.0","@angular/platform-browser-dynamic": "^4.0.0","@angular/router": "^4.0.0" 我建议尝试: >如果需要,请更新动画库 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |