请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

老师,这章视频CSSTransition位置直接在NavSearch上写一个transition不好吗?

export const NavSearch = styled.input.attrs({
	type: 'text', placeholder: '搜索'
})`
	width: 240px;
	height: 38px;
	border: none;
	border-radius: 19px;
	background: #eee;
	padding: 0 40px 0 20px;
	box-sizing: border-box;
	margin-top: 9px;
	outline: none;
	transition: all 0.2s ease-out;
	&::placeholder {
		color: #999;
	}
	&.focused {
		width: 320px;
	}
`;

像老师这样写感觉好麻烦,这样写感觉可以省去使用CSSTransition,还是使用react-transition-group对性能有所提升吗?


正在回答 回答被采纳积分+3

1回答

Dell 2018-07-27 11:34:00

是这样的,简单动画cssTransition足够了,但是复杂动画,就得使用react-transition-group了,我这主要是给介绍下这个模块

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号