【发布时间】:2016-03-01 11:18:40
【问题描述】:
我有这个代码:
{{#each hotspots as |hotspot|}}
{{#unless (eq hotspot.x_axis "")}}
{{#if (eq categoryId hotspot.category)}}
{{#draggable-item content=hotspot.id dragEnter=(action "setIsDragged" "isDragged") dragEnd=(action "setIsDragged" false)}}
<div {{action 'showMarkerModal' hotspot.id}} class="normal-markers {{isDragged}}" style="position:absolute;top:{{{hotspot.y_axis}}}px;left:{{{hotspot.x_axis}}}px;"><i class="fa fa-map-marker {{isDragged}}"></i></div>
{{/draggable-item}}
<span style="position:absolute;top:{{{hotspot.y_axis}}}px;left:{{{hotspot.x_axis}}}px;">
</span>
{{/if}}
{{/unless}}
{{/each}}
这给了我以下警告:
警告:绑定样式属性可能会引入跨站点脚本 漏洞;请确保绑定的值正确 逃脱了。有关更多信息,包括如何禁用此警告, 看 http://emberjs.com/deprecations/v1.x/#toc_binding-style-attributes.
我知道为什么会抛出警告,但我不知道如何绑定内联属性,因为 x_axis 和 y_axis 来自车把文件本身。所以我不能做一个计算属性来解决这个问题。
有没有人遇到过这种情况并知道如何解决?
【问题讨论】:
标签: ember.js