看来聚合物的
polyfill-next-selector { content: ':host #myId' }
不适用于 VanillaJS<template>
和自定义元素(在 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
属性也无济于事。
有什么解决方法,还是我用错了?