有没有办法用其父模板包围 polymer 子模板?
在下面的示例中,shadow 标签将父 View 的模板带入 subview ,但它忽略了其内容:
母体 polymer 元件
<polymer-element name="my-window">
<template>
<div class="windowframe">
<p>test</p> <!-- can be shown with shadow tag -->
<content></content> <!-- cannot be used with shadow tag -->
子 polymer 元件
<polymer-element name="my-window-example" extends="my-window">
<template>
<!-- get the hosts' shadow and insert here -->
<shadow>
<p>Here is the content of my window<p> <!--won't be shown -->
</shadow>
</template>
最佳答案
这曾经在 Chrome Canary 中是可能的(请参阅 this blog post 、 this discussion 、 the fixed spec bug 和 the fixed Chromium bug ),但不幸的是,它在 Linux 或 Linux 上的 Chrome 33.0.1750.22 dev 中似乎不再适用于我Windows 上的 Chrome 34.0.1809.0 canary 启用或关闭“启用实验性 Web 平台功能”标志。试试 this jsbin看看它是否适合你。
更新 :Confirmed .由于“实现问题”,此功能已从 Chrome 中 Shadow DOM 的初始实现中删除。
关于dart - 嵌套 polymer 模板继承,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21395702/