简体   繁体   English

有条件地水平翻转图标的样式 { rotateY: '180deg'}

[英]Style to conditionally flip an Icon horizontally { rotateY: '180deg'}

我知道它有效,因为我过去使用过它,但是这一次让我很难受,我不确定我做错了什么。

<Icon type={sensorKey}  style={sensorKey==='car'?[{...activityStyles.icon}, {transform: [{ rotateY: '180deg'}]}]:activityStyles.icon} size={Typography.bodyLineHeight} />

只需设置: transform: rotateY(180deg)

We need you to provide an example of your html and css in order to give you the help you are asking for.我们需要您提供一个 html 和 css 示例,以便为您提供所需的帮助。 Without it all we can do it guess.没有它,我们可以猜测。

But I will take a stab at it (note I added more for cross browser functionality):但我会尝试一下(请注意,我为跨浏览器功能添加了更多内容):

-ms-transform: rotateY(180deg); /* IE 9 */
-webkit-transform: rotateY(180deg); /* Safari 3-8 */
transform: rotate(180deg);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM