【发布时间】:2016-11-08 17:02:36
【问题描述】:
我正在尝试应用到 DIV,使用 Angular 2 样式指令,transform 属性:
<div
[style.width.px]="front.width"
[style.height.px]="front.height"
[style.background-color]="front.backgroundColor"
[style.transform]="front.transform"></div>
组件数据为:
front['width'] = this.width + this.gapw;
front['height'] = this.height + this.gaph;
front['background-color'] = settings.backfacesColor;
front['transform'] = 'rotate3d( 0, 1, 0, 0deg ) translate3d( 0, 0, ' + hw + 'px )';
我在控制台中收到此警告:
WARNING: sanitizing unsafe style value rotate3d( 0, 1, 0, 0deg ) translate3d( 0, 0, 207px )
browser_adapter.js:83 WARNING: sanitizing unsafe style value rotate3d( 0, 1, 0, 0deg ) translate3d( 0, 0, 207px )
browser_adapter.js:83 WARNING: sanitizing unsafe style value rotate3d( 0, 1, 0, 180deg ) translate3d( 0, 0, 207px ) rotateZ( 180deg )
应用了宽度和背景颜色等标准样式。未应用 Trasnform。有什么想法吗?
【问题讨论】:
-
@DanielPliscki 也许内容是一样的,但这个问题是可怕的。我在发帖前搜索了一下,没有发现任何关于这个问题的信息。
-
我已经用我的解决方案更新了答案。