angular - 角度动画:过渡不起作用
问题描述
我正在尝试制作动画,当在标题中单击图像时,导航栏会从左侧滑入。一切似乎工作正常,当我单击图像时,导航栏消失/出现,除了过渡。
content.component.html
<app-nav [@slideMenu]="isVisible ? true : false" [hidden]="!isVisible"></app-nav>
<app-main></app-main>
内容.component.ts
@Component({
selector: 'app-content',
templateUrl: './content.component.html',
styleUrls: ['./content.component.css'],
animations: [
trigger('slideMenu', [
state('false', style({
transform: 'translateX(-350px)'
})),
state('true', style({
transform: 'translateX(0)'
})),
transition('true <=> false', animate('500s ease-in-out'))
])
]
})
我希望导航栏在这 500 毫秒内滑入。
解决方案
推荐阅读
- html - 在提交之前向 HTML 表单输入框中的现有值添加附加字符串
- java - 如何将 TextView 放在 Button 前面
- reactjs - 流 - 无法使用“Home”扩展“组件”,因为对象文字 [2] 与属性“状态”中的未定义 [3] 不兼容
- python - 从 JSON 将多种食物写入数据库
- angular - 角度 6 单元测试 - 如何注入具有静态属性的类进行测试
- r - 使用 tidyquant R 遍历参数列表
- javascript - setTimeout 执行自身,但不执行其功能: css.("background-color")
- python - Django 1.11:尚未加载应用程序
- html - 更改 CSS 中的背景颜色(现场明暗主题)
- r - 运行 lm 时“找不到对象”