Polymer 1.0:如何使<paper-menu-button>示例正常工作?

时间:2015-10-09 10:58:39

标签: polymer polymer-1.0 paper-elements

如何使<paper-menu-button>下拉列表正常工作? Here is a jsBin

http://jsbin.com/xamixicuna/4/edit?html,output
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base href="http://polygit.org/polymer:+v1.1.0/components/">
  <title>JS Bin</title>
  <link rel="import" href="polymer/polymer.html">
  <link rel="import" href="iron-icons/iron-icons.html">
  <link rel="import" href="paper-menu-button/paper-menu-button.html">
  <link rel="import" href="paper-icon-button/paper-icon-button.html">
  <link rel="import" href="paper-menu/paper-menu.html">
  <link rel="import" href="paper-item/paper-item.html">
</head>  
<body>
Click the below menu icon to make the dropdown menu appear.
<br>
<paper-menu-button>
  <paper-icon-button icon="menu" 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>
</body>
</html>

2 个答案:

答案 0 :(得分:3)

添加了webcomponents,似乎正在运行:http://jsbin.com/rucejo/2/edit?html,output

答案 1 :(得分:1)

优异。

如果您使用<paper-menu-button>&gt;中的<paper-toolbar您需要先使用<div>标签。 <paper-toolbar>不支持<paper-menu-button>