将聚合物元素3.0(例如:纸卡和纸按钮)插入pwa-starter-kit视图之一(例如:my-view2.js)后,无法正确显示。插入的元素显示为与APP布局重叠,就像这张图片中的纸卡一样。
我试图更改元素导入的顺序和位置(例如,在不同的视图中,例如在my-app.js中)。
import { html } from '@polymer/lit-element';
import { PageViewElement } from './page-view-element.js';
import '@polymer/paper-card/paper-card.js';
import '@polymer/paper-button/paper-button.js';
class MyView1 extends PageViewElement {
render() {
return html`
${SharedStyles}
<section>
<h2>Static page</h2>
<p>This is a text-only page.</p>
<p>It doesn't do anything other than display some static text.</p>
</section>
<section>
<h2>Welcome</h2>
<paper-card heading="Emmental" alt="Emmental">
<div class="card-content">
Emmentaler or Emmental is a yellow, medium-hard cheese that originated in the area around Emmental, Switzerland. It is one of the cheeses of Switzerland, and is sometimes known as Swiss cheese.
</div>
<div class="card-actions">
<paper-button>Share</paper-button>
<paper-button>Explore!</paper-button>
</div>
</paper-card>
`;
}
}
window.customElements.define('my-view1', MyView1);