【发布时间】:2014-12-18 18:23:46
【问题描述】:
大家早上好,
我目前正在尝试更改我的小部件的背景颜色。不知何故,它只是行不通。
这是我的工作文件提供的内容:
return_array.push({value: value, label: row[0], color: color})
network = status_array[0..1] # This is pretty much return_array
send_event('network', {items: network[0]}) # sending data to the widget with data-id network
我使用的小部件是列表小部件。
这是我的 Coffeescript 文件的样子:
class Dashing.List extends Dashing.Widget
onData: (data) ->
color = data.items.color
$(@node).addClass "#{color}"
...
颜色代表“红色”或“绿色”
在我的 css 文件中,我的设置如下:
.green {
background-color: $background-color;
}
.red {
background-color: #f13a2a;
}
有没有人知道为什么它不会添加类?我可以提醒颜色并取回红色/绿色的值
【问题讨论】:
标签: css coffeescript dashing