我已经在聚合物 0.5 中构建了我的应用程序。
现在我已将其更新为聚合物 1.0。
对于响应式布局,我使用了 Polymer 0.5 中使用布局属性的自定义逻辑的布局属性。
请看下面的代码:
<template is="auto-binding">
<core-media-query query="max-width: 767px" queryMatches="{{smallScreen}}"></core-media-query>
<section layout vertical?="{{smallScreen}}" horizontal?="{{!smallScreen}}">
<section flex four?="{{!smallScreen}}" auto?="{{smallScreen}}">
<paper-input-decorator label="First name" floatingLabel>
<input type="text" is="paper-input" id="fname" name="fname">
</paper-input-decorator>
</section>
<section flex four?="{{!smallScreen}}" auto?="{{smallScreen}}">
<paper-input-decorator label="Last name" floatingLabel>
<input type="text" is="paper-input" id="lname" name="lname">
</paper-input-decorator>
</section>
</section>
</template>
现在在聚合物 1.0 中引入了一个元素“iron-layout-flex”,所有迹象都表明,现在我们必须使用“.layout”、“.horizontal”、“.vertical”类而不是属性?我应该如何根据布局属性的逻辑进行调整,这非常令人困惑。
所以,我的问题是,有没有办法使用“布局”作为属性而不是 CSS 类或在类属性中使用属性序列化?