首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使纸菜单按钮工作?

如何使纸菜单按钮工作?
EN

Stack Overflow用户
提问于 2017-07-10 07:40:06
回答 1查看 415关注 0票数 1

当本地服务于下面的演示时,我不断地收到错误抱怨无法运行动画。虽然它在我的jsBin中确实有效

http://jsbin.com/kadugokade/edit?html,console,output

代码语言:javascript
复制
<!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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-07-10 07:44:15

检查是否安装了以下导入所需的web-animations-js/目录。

bower_components/neon-animation/web-animations.html

代码语言:javascript
复制
<script src="../web-animations-js/web-animations-next-lite.min.js"></script>

您必须使用以下方法导入它:

代码语言:javascript
复制
bower install --save web-animations/web-animations-js
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45006294

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档