标签:red 钩子 mount bsp com style tps ide state
安裝:cnpm i react-transition-group
详细介绍:
https://reactcommunity.org/react-transition-group/css-transition
/* 显示 */ /* fade-appear第一次显示执行的样式 */ .fade-enter,fade-appear{ opacity: 0; } .fade-enter-active,fade-appear-active{ opacity: 1; transition: opacity 1s ease-in ; } .fade-enter-done,fade-appear-done{ /* 动画执行完成后保留的样式 */ opacity: 1; } /* 隐藏 */ .fade-exit{ opacity: 1; } .fade-exit-active{ opacity: 0; transition: opacity 1s ease-in ; } .fade-exit-done{ opacity: 0; }
还需要引入定义的样式效果 需要的文件中引入:import { CSSTransition } from ‘react-transition-group‘;
transition-group:https://reactcommunity.org/react-transition-group/transition-group
给多个div添加样式
标签:red 钩子 mount bsp com style tps ide state
原文地址:https://www.cnblogs.com/nothingness/p/13222102.html