【发布时间】:2014-06-30 19:31:16
【问题描述】:
好像是聚合物的
polyfill-next-selector { content: ':host #myId' }
不适用于 VanillaJS <template>s 和自定义元素(在 IE 中)。
对于<polymer-element>,它工作正常:http://codepen.io/robdodson/pen/FokEw/,但由于某种原因,当我尝试对原生 JS 做同样的事情时,它却没有
<template>
<style>
polyfill-next-selector { content: ':host h1' }
::content h1 {
color: red;
}
</style>
..ShadowDOM stuff..
<content></content>
</template>
<my-element>
<h1>Hello World, I'm red content of Custom Element</h1>
</my-element>
http://codepen.io/tomalec/pen/apqgr
shim-shadowdom 属性也没有帮助。
有什么解决方法,还是我用错了?
【问题讨论】:
标签: javascript html polymer web-component shadow-dom