简体   繁体   English

带铁页模型装订的聚合物纸标签

[英]Polymer paper-tab with iron-pages model binding

How to handle model inside polymer iron-pages for paper-tab. 如何处理制表纸的聚合物铁页内部的模型。 See my code below: 请参阅下面的代码:

<paper-tabs selected="{{selected}}">
 <paper-tab>Tab 1</paper-tab>
 <paper-tab>Tab 2</paper-tab>
</paper-tabs>
<iron-pages selected="{{selected}}">
 <div>
       {{model.tab1.content}} //not working
 </div>
 <div>
        {{model.tab2.content}} //not working
 </div>
</iron-pages>
<script>
        Polymer({
            is: "my-element",
            properties: {
                model: {
                    type: Object,
                    value: {tab1...}
                }
            }
        });
    </script>

So, model.tab1.content is not working inside iron-pages. 因此,model.tab1.content在Iron-pages内部不起作用。

You can create a custom element that wraps both paper-tabs and iron-pages then the two way binding of the selected attribute will cause the tabs and pages to be in sync. 您可以创建一个包装纸标签和铁页的自定义元素,然后所选属性的两种方式绑定将使标签和页面同步。

here is a link to a gist for easy-paper-tabs 这是用于轻松打印纸的要点的链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM