博客
关于我
Angular开发(二十五)-angular自带动画效果
阅读量:123 次
发布时间:2019-02-26

本文共 862 字,大约阅读时间需要 2 分钟。

angular2中使用自带的动画

一、在组件中创建一个动画

import {Component,OnInit,style,trigger,state,transition,animate,keyframes} from '@angular/core';@Component({  selector: 'app-page1',  templateUrl: './page1.component.html',  styleUrls: ['./page1.component.css'],  animations:[    //可以设置多个动画    trigger("动画名称",[      state("状态名称",style({        transform:"scale(1)" //设置样式      })),      state("active",style({        transform:"scale(1.5)" //设置样式      })),      //设置从一个状态到另外一个状态的运动效果,非必填字段      transition("inactive=>active",animate("100ms ease-in")),      transition("active=>inactive",animate("100ms ease-out")),    ])  ]})

二、在html页面中使用动画

三、操作动画

export class Page1Component implements OnInit {  private loginBtnState:string = "inactive";  constructor() { }  ngOnInit() {  }  //绑定事件  toggleLoginState(state:boolean){    this.loginBtnState = state ? "active":"inactive";  }}

四、

转载地址:http://svvf.baihongyu.com/

你可能感兴趣的文章
mysql 字段区分大小写
查看>>
mysql 字段合并问题(group_concat)
查看>>
mysql 字段类型类型
查看>>
MySQL 字符串截取函数,字段截取,字符串截取
查看>>
MySQL 存储引擎
查看>>
mysql 存储过程 注入_mysql 视图 事务 存储过程 SQL注入
查看>>
MySQL 存储过程参数:in、out、inout
查看>>
mysql 存储过程每隔一段时间执行一次
查看>>
mysql 存在update不存在insert
查看>>
Mysql 学习总结(86)—— Mysql 的 JSON 数据类型正确使用姿势
查看>>
Mysql 学习总结(87)—— Mysql 执行计划(Explain)再总结
查看>>
Mysql 学习总结(88)—— Mysql 官方为什么不推荐用雪花 id 和 uuid 做 MySQL 主键
查看>>
Mysql 学习总结(89)—— Mysql 库表容量统计
查看>>
mysql 实现主从复制/主从同步
查看>>
mysql 审核_审核MySQL数据库上的登录
查看>>
mysql 导入 sql 文件时 ERROR 1046 (3D000) no database selected 错误的解决
查看>>
mysql 导入导出大文件
查看>>
MySQL 导出数据
查看>>
mysql 将null转代为0
查看>>
mysql 常用
查看>>