如何让纸质菜单按钮工作?
How to get paper-menu-button to work?
我不断收到错误消息,抱怨在本地提供以下演示时无法 运行 动画。 Although it does work in my jsBin.
http://jsbin.com/kadugokade/edit?html,console,output
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<base href="http://polygit.org/polymer+:master/components/">
<script src="webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="polymer/polymer-element.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-listbox/paper-listbox.html">
<link rel="import" href="paper-item/paper-item.html">
<link rel="import" href="iron-icons/iron-icons.html">
<link rel="import" href="iron-icon/iron-icon.html">
<!-- Ensure Web Animations polyfill is loaded since neon-animation 2.0 doesn't import it -->
<link rel="import" href="neon-animation/web-animations.html">
</head>
<body>
<dom-module id="my-el">
<template>
<paper-menu-button>
<paper-icon-button icon="menu" slot="dropdown-trigger" alt="menu"></paper-icon-button>
<paper-listbox slot="dropdown-content">
<paper-item>alpha</paper-item>
<paper-item>beta</paper-item>
<paper-item>gamma</paper-item>
<paper-item>delta</paper-item>
<paper-item>epsilon</paper-item>
</paper-listbox>
</paper-menu-button>
</template>
<script>
class MyEl extends Polymer.Element {
static get is() { return 'my-el' }
}
customElements.define(MyEl.is, MyEl);
</script>
</dom-module>
<my-el></my-el>
</body>
</html>
检查您是否安装了 web-animations-js/
目录,这是以下导入所必需的。
bower_components/neon-animation/web-animations.html
<script src="../web-animations-js/web-animations-next-lite.min.js"></script>
您必须使用以下方式导入它:
bower install --save web-animations/web-animations-js
我不断收到错误消息,抱怨在本地提供以下演示时无法 运行 动画。 Although it does work in my jsBin.
http://jsbin.com/kadugokade/edit?html,console,output<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<base href="http://polygit.org/polymer+:master/components/">
<script src="webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="polymer/polymer-element.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-listbox/paper-listbox.html">
<link rel="import" href="paper-item/paper-item.html">
<link rel="import" href="iron-icons/iron-icons.html">
<link rel="import" href="iron-icon/iron-icon.html">
<!-- Ensure Web Animations polyfill is loaded since neon-animation 2.0 doesn't import it -->
<link rel="import" href="neon-animation/web-animations.html">
</head>
<body>
<dom-module id="my-el">
<template>
<paper-menu-button>
<paper-icon-button icon="menu" slot="dropdown-trigger" alt="menu"></paper-icon-button>
<paper-listbox slot="dropdown-content">
<paper-item>alpha</paper-item>
<paper-item>beta</paper-item>
<paper-item>gamma</paper-item>
<paper-item>delta</paper-item>
<paper-item>epsilon</paper-item>
</paper-listbox>
</paper-menu-button>
</template>
<script>
class MyEl extends Polymer.Element {
static get is() { return 'my-el' }
}
customElements.define(MyEl.is, MyEl);
</script>
</dom-module>
<my-el></my-el>
</body>
</html>
检查您是否安装了 web-animations-js/
目录,这是以下导入所必需的。
<script src="../web-animations-js/web-animations-next-lite.min.js"></script>
您必须使用以下方式导入它:
bower install --save web-animations/web-animations-js