famo.us表面是否支持伪CSS选择器?具体来说,我试图在 InputSurface 上设置占位符文本的样式。没有给它一个类并使用CSS的任何方式这样做?
答案 0 :(得分:2)
此时Famo.us尚未创建任何特殊的伪元素样式助手。 Famo.us支持通过Surface对象的setProperties
更改样式。
0.3.0版中的Surfaces也支持attributes选项。添加placeholder
的属性,如下面的代码所示。
<强> Example of working code here 强>
var surface = new InputSurface({
size: [200, true],
content: '',
attributes: {
placeholder: 'Enter Something'
}
});
您还可以使用setAttributes方法:
var surface = new InputSurface({
size: [200, true],
content: ''
});
surface.setAttributes({ placeholder: 'Enter Something'});
surface.setProperties({borderColor:'red'});