Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';当聚合物数据绑定到自定义html标记时,它不能在标准标记上工作_Html_Css_Data Binding_Polymer - Fatal编程技术网

Can';当聚合物数据绑定到自定义html标记时,它不能在标准标记上工作

Can';当聚合物数据绑定到自定义html标记时,它不能在标准标记上工作,html,css,data-binding,polymer,Html,Css,Data Binding,Polymer,我使用的是polymer 1.3.1,但无法在名为的polymer元素中实现以下功能:poly main。的文本应为红色,但不是 <div testcolor="[[colorLocalRed]]"> -->ERROR This must be RED because testcolor="[[colorLocalRed]]" (expected "myred" and styles.css translates this to color="red") </div&g

我使用的是polymer 1.3.1,但无法在名为的polymer元素中实现以下功能:
poly main
的文本应为红色,但不是

<div  testcolor="[[colorLocalRed]]">
-->ERROR This must be RED because testcolor="[[colorLocalRed]]"
(expected "myred" and styles.css translates this to color="red")
</div>
以及以下内部样式.css:'

[testcolor="myred"] {
  color: red;
}
注:以下各项应按要求进行:
一些红色文本


不使用自定义标记
testcolor
,但直接使用样式或颜色不是一个选项,因为此示例仅显示数据绑定到非标准html标记的问题

,我想这就是您想要的:

<div  testcolor$="[[colorLocalRed]]">

$
添加到属性名会绑定到属性,而不是CSS中无法寻址的属性


有关更多详细信息,请参见

谢谢,它可以工作,35秒后就可以了。你能给我指一下有关使用美元的更多信息吗。(
testcolor$=“myred”
不起作用,但仍必须表示为
testcolor=“myred”
我添加了答案的链接。
<div  testcolor$="[[colorLocalRed]]">