0

Hello guys i have a trouble with using javascript plugin on polymer. How i include and use javascript plugin in my project.

@JavaScript("js/main.js")

this is my java class using javascript annotation. But its not working.

Using javascript annotation in my class.

And here is my html

<link rel="import" href="../../bower_components/polymer/polymer-element.html">
<dom-module id="main-page">
    <template>
        <style>
</style>
 </template>
    <script>
    class MainPage extends Polymer.Element {
        static get is() {
            return 'main-page'
        }
    }

    customElements.define(MainPage.is, MainPage);
    </script>
</dom-module>

Any advice ?

4

1 回答 1

2

我怀疑JS文件不在注解指定的目录中。这是一个演示项目结构的示例@JavaScript

在此处输入图像描述

当您运行该示例时,您应该在浏览器中看到以下内容。

在此处输入图像描述

您可以在此处找到示例项目:https ://github.com/oluwasayo/demo-flow-js

于 2018-03-13T11:41:39.717 回答