聚合物 - 纸张标签内的纸质徽章

时间:2016-06-08 04:38:46

标签: polymer

做的时候

let injector = ReflectiveInjector.resolveAndCreate([HTTP_PROVIDERS]);
let http = injector.get(Http);
http.get('http://someurl').subscribe(...)

徽章只显示在标签内部,标签元素外面的另一半隐藏在某些内容之后。

如何才能显示完整的图标?

1 个答案:

答案 0 :(得分:2)

根据您的有限示例,我无法重现您描述的确切症状。但是,我遇到了类似的问题,当iron-select事件被触发时,徽章被重新定位。作为解决方法,我将for="_"添加到<paper-badge>

&#13;
&#13;
<head>
  <base href="https://polygit.org/polymer+1.5.0/components/">
  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link rel="import" href="paper-tabs/paper-tabs.html">
  <link rel="import" href="paper-badge/paper-badge.html">
</head>
<body>
  <style is="custom-style">
    paper-badge {
      --paper-badge-margin-left: 60px;
      --paper-badge-margin-bottom: 20px;
    }
  </style>
  <paper-tabs selected="0">
    <paper-tab>
      <span>TAB 1</span>
      <paper-badge for="_" label="4"></paper-badge>
    </paper-tab>
    <paper-tab>TAB 2</paper-tab>
    <paper-tab>TAB 3</paper-tab>
  </paper-tabs>
</body>
&#13;
&#13;
&#13;

codepen