做的时候
let injector = ReflectiveInjector.resolveAndCreate([HTTP_PROVIDERS]);
let http = injector.get(Http);
http.get('http://someurl').subscribe(...)
徽章只显示在标签内部,标签元素外面的另一半隐藏在某些内容之后。
如何才能显示完整的图标?
答案 0 :(得分:2)
根据您的有限示例,我无法重现您描述的确切症状。但是,我遇到了类似的问题,当iron-select
事件被触发时,徽章被重新定位。作为解决方法,我将for="_"
添加到<paper-badge>
:
<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;