easy-transition
React 实现的动画组件。
Install
$ npm i easy-transition
Demo
import React Component from "react";import ReactDOM from "react-dom";import Transition from "easy-transition"; const status = TransitionStatus; state = isIn : true ; { const isIn = thisstate; return <div> <Transition = = = => <MyComponent =/> </Transition> <button =>button</button> </div> } { thisrect = ReactDOM; } { const text = thisprops; const style = this; return <div =>text</div> } { const style = ; const transitionStatus = thisprops; styleoverflow = 'hidden'; switch transitionStatus case statusenter: styleheight = 0; break; case statusentering: styleheight = thisrectheight; styletransitionProperty = 'all'; styletransition = '0.3s'; break; case statusentered: styleheight = thisrectheight; break; case statusexit: styleheight = thisrectheight; break; case statusexiting: styleheight = 0; styletransitionProperty = 'all'; styletransition = '0.3s'; break; case statusexited: styleheight = 0; break; return style; }
Update
版本 | 更新内容 |
---|---|
0.1.0 | 实现基础功能。 |