visibility: IsShow? "visible" : "hidden",
opacity: IsShow? 1 : 0,
transition: "all 0.8s ease"
IsShow是一个控制显示和透明度的变量,可以用代码控制
注意:transition只对opacity有效果,但是因为这里增加了visbility,所以不能只用opacity:
transition: "opacity 0.8s ease"
需要用all:
transition: "all 0.8s ease"