“核心页眉面板"开箱即用 [英] "core-header-panel" doesnt seem to work out-of-the-box

查看:77
本文介绍了“核心页眉面板"开箱即用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试某些core聚合物元素,并且在

I was trying some core polymer elements, and I have been having trouble using core-header-panel in my demo.

我认为工具栏是正确的,因为我设法完成了另一个演示它使用最少的CSS.但是我为core-header-panel找到的所有演示似乎都将大多数布局配置都带到了组件之外(有点像组件的要点).我在这里误解了吗?

I think the toolbar is right, because I managed to do another demo where it was working with minimal CSS. But all the demo I found for core-header-panel seems to take most of the layout configuration outside the component (Which kinda seems like the point of the component). Did I misinterpret something here?

推荐答案

当今最好的模式是使用聚合物布局属性.

The best pattern today is to use the polymer layout attributes.

<body fullbleed vertical layout>
  <core-header-panel flex>

vertical layout使主体成为一个(垂直)柔性盒,并且core-header-panel上的flex属性将使其填充可用空间. fullbleed属性设置主体以适合视口.

vertical layout makes the body a (vertical) flex-box, and the flex attribute on the core-header-panel will make it fill the available space. fullbleed attribute sets body to fit the viewport.

与使用fit相比,这通常是一种更好的模式,因为弹性盒更具弹性.您可以在正文中添加其他页眉或页脚,然后柔性面板就会适应.

This is a better pattern in general than using fit because flex-boxes are more resilient. You could add a different header or footer to body, and the flex panel will adapt.

此外,使用layout容器和flex子代是一种模式,您可以继续在应用程序的其他位置使用该模式.

Also, using layout containers and flex children is a pattern you can continue to use in other places in the application.

这篇关于“核心页眉面板"开箱即用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆