angular2动态更改样式属性值
发布时间:2020-12-17 17:51:07 所属栏目:安全 来源:网络整理
导读:我需要更新图像的变换旋转值,该值随时间动态变化 我尝试过类似下面的东西,但它没有用 style =“transform:rotate(imagerotation?imagerotation:0 deg);” 实现这个目标的正确方法是什么? 解决方法 试试这个: [style.transform]="'rotate(' + (imagerota
我需要更新图像的变换旋转值,该值随时间动态变化
我尝试过类似下面的东西,但它没有用 style =“transform:rotate(imagerotation?imagerotation:0 deg);” 实现这个目标的正确方法是什么? 解决方法
试试这个:
[style.transform]="'rotate(' + (imagerotation ? imagerotation : 0) + 'deg)'" (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容