阴影中的聚合物英雄过渡 dom

polymer hero transition in shadow dom

我有一个位于聚合物元素中的英雄过渡。文档指出转换将适用于最多 1 级影子根。 (https://www.polymer-project.org/docs/elements/core-elements.html#core-animated-pages)。但是,它不起作用。

如果我将元素移出 shadow dom,它会按预期工作。

<polymer-element name="x-el" noscript>
  <template>
    <div hero-id="hero-test" hero> GO HERO </div>
  </template>
</polymer-element>

<core-animated-pages transitions="hero-transition cross-fade">
        <section>
            // works
            <div hero-id="hero-test" hero> GO HERO </div>

            // doesn't work
            <x-el></x-el>
        </section>

        <section>
            <div hero-id="hero-test" hero> YAY </div>
        </section>
</core-animated-pages>

现场演示:http://codepen.io/nicolasrannou/pen/zxNYMw

我是不是漏掉了什么?

谢谢

只需删除自定义元素外的 "section" 就可以了!

    <!--<section>-->
        <x-el onclick="stuff(1);"></x-el>
    <!--</section>-->

检查这个:http://codepen.io/anon/pen/yygydK

祝你好运