<polymer-element name="ele-polyrow" extends="div">
</polymer-element>
是否可以添加ele-polyrow元素的样式。
答案 0 :(得分:3)
不确定。在元素模板中使用:host
伪类。但有几点需要注意:
<div is="ele-polyrow">
而非<ele-polyrow>
。noscript
属性,Polymer会自动为您注册。 将这些东西放在一起,你得到:
<polymer-element name="ele-polyrow" extends="div" noscript>
<template>
<!-- shadow DOM for the element -->
<style>
:host {
outline: 2px solid red;
}
</style>
<!-- display any children -->
<content></content>
</template>
</polymer-element>
<div is="ele-polyrow">Hey there polyrow!</div>