Paper-scroll-header-panel 对比 Paper-header-panel

Paper-scroll-header-panel vs Paper-header-panel

我可能会为此投票,但无论如何我都要问...我什么时候会使用 paper-scroll-header-panel 而不是 paper-header-panel?似乎在功能上有重叠 - 都滚动,都是 headers,都共享一些视觉效果,等等。

我看到它们有不同的属性 api...但是缺少属性不会阻止我实现自己的 behavior/style。我想我还想澄清两者之间的预期用途。

根据 docs

paper-scroll-header-panel contains a header section and a content section. The header is initially on the top part of the view but it scrolls away with the rest of the scrollable content. Upon scrolling slightly up at any point, the header scrolls back into view.

您可以查看 demo 以查看此行为的实际效果。

paper-header-panel 仅提供 header 和可滚动的内容区域,没有 "advanced" 滚动行为。