我有以下代码:
<paper-toolbar id="mainToolbar">
<paper-icon-button id="paperToggle" icon="menu" paper-drawer-toggle></paper-icon-button>
<div class="app-name">Dashbord</div>
<span class="flex"></span>
<paper-menu-button horizontalAlign="right" horizontalOffset="20" verticalAlign="top" verticalOffset="50">
<paper-icon-button icon="more-vert" class="dropdown-trigger"></paper-icon-button>
<paper-menu class="dropdown-content">
<paper-item>Share</paper-item>
<paper-item>Settings</paper-item>
<paper-item>Help</paper-item>
</paper-menu>
</paper-menu-button>
</paper-toolbar>
菜单按钮按预期工作,但下拉horizontalAlign
和horizontalOffset
属性不会生效。
我让下拉菜单工作的唯一方法是对元素定义中的值进行硬编码:
<iron-dropdown
id="dropdown"
opened="{{opened}}"
horizontal-align="right"
vertical-align="top"
horizontal-offset="50"
vertical-offset="20"
open-animation-config="[[openAnimationConfig]]"
close-animation-config="[[closeAnimationConfig]]"
no-animations="[[noAnimations]]"
focus-target="[[_dropdownContent]]">
<paper-material class="dropdown-content">
<content id="content" select=".dropdown-content"></content>
</paper-material>
</iron-dropdown>