是否可以从子元素中选择内容?

时间:2015-12-04 10:48:17

标签: polymer-1.0

是否可以从Polymer 1中的子元素中选择内容?在文档中找不到任何关于它的内容,但这不起作用:

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <script src="https://rawgit.com/webcomponents/webcomponentsjs/master/webcomponents.js"></script>
    <base href="http://polygit.org/polymer+:master/components/">
    <link rel="import" href="polymer/polymer.html">


    <dom-module id="my-element">

        <template>
            <content select="#aaa"></content>
        </template>

        <script>
            HTMLImports.whenReady(function () {
                Polymer({
                    is: "my-element"
                });
            });
        </script>

    </dom-module>

</head>

<body>
<my-element>
    <div>
        <div id="aaa">zzzzzzzzzzz</div>
    </div>
</my-element>
</body>

</html>

1 个答案:

答案 0 :(得分:0)

没办法!!聚合物1中的一切都改变了。 本文档将为您提供很多帮助:Polymer Elements docs