gpt4 book ai didi

javascript - 引用错误 : KeyframeEffect is not defined in paper component

转载 作者:搜寻专家 更新时间:2023-11-01 05:09:28 24 4
gpt4 key购买 nike

我正在构建一个 Web 应用程序,对于下拉列表,我使用的是 paper-dropdown-menu我的代码非常简单,并且紧跟展示的演示 here

代码片段如下:

<link rel="import" href="/polymer/polymer-element.html">
<link rel="import" href="/paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="/paper-item/paper-icon-item.html">
<link rel="import" href="/paper-listbox/paper-listbox.html">
<link rel="import" href="/iron-icons/maps-icons.html">

<dom-module id="isochrone-settings-element">
<template>
...

<div id="settings">
<paper-dropdown-menu label="Travel mode">
<paper-listbox slot="dropdown-content" attr-for-selected="value" selected={{selectedItem}}>
<paper-icon-item value="auto">
<iron-icon icon="maps:directions-car" slot="item-icon"></iron-icon>Driving
</paper-icon-item >
<paper-icon-item value="bicycle">
<iron-icon icon="maps:directions-bike" slot="item-icon"></iron-icon>Cycling
</paper-icon-item>
<paper-icon-item value="bus">
<iron-icon icon="maps:directions-bus" slot="item-icon"></iron-icon>Bus
</paper-icon-item>
<paper-icon-item value="pedestrian">
<iron-icon icon="maps:directions-walk" slot="item-icon"></iron-icon>Walking
</paper-icon-item>
</paper-listbox>
</paper-dropdown-menu>
</div>

</template>
.....

</dom-module>

问题是,当我尝试使用 webapp 中的下拉菜单时,出现以下错误:

neon-animation-runner-behavior.html:40 Couldnt play ( fade-in-animation ). ReferenceError: KeyframeEffect is not defined
at HTMLElement.configure (fade-in-animation.html:39)
at HTMLElement._configureAnimations (neon-animation-runner-behavior.html:33)
at HTMLElement.playAnimation (neon-animation-runner-behavior.html:93)
at HTMLElement._renderOpened (iron-dropdown.html:233)
at HTMLElement.__openedChanged (iron-overlay-behavior.html:541)
at nextAnimationFrame (iron-overlay-behavior.html:566)

每次使用菜单时,至少会抛出 3 次相同的错误。

我现在正在调查组件本身,但由于我没有发现很多在网络上看起来相关的问题,我认为问题可能出在我身上。

这段代码有什么明显的错误吗?

谢谢

最佳答案

您需要包含 WebAnimation API 的 polyfill。您尝试使用的动画仅在 Chrome Canary 中可用。只需添加:

<link rel="import" href="../../neon-animation/web-animations.html">

The documented line in the source code can be found here.

And here you will receive updates if the need to include this changes

关于javascript - 引用错误 : KeyframeEffect is not defined in paper component,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45198871/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com