更新时间:2023-02-19 17:08:09
要将内容从灯光dom渲染到Polymer元素的阴影中,请使用
To render content from the light dom into your Polymer element's shadow use an insertion point: <content>
. Also to style the host element, you can use the :host
selector. Both are features of Shadow DOM.
<polymer-element name="x-strong" noscript>
<template>
<style>
:host {
font-weight: bold;
}
</style>
<content></content>
</template>
</polymer-element>