[英]How to use third party javascript plugin in polymer 2.x
Hello guys i have a trouble with using javascript plugin on polymer. 大家好,我在聚合物上使用javascript插件时遇到了麻烦。 How i include and use javascript plugin in my project.
我如何在项目中包含和使用javascript插件。
@JavaScript("js/main.js")
this is my java class using javascript annotation. 这是我的Java类,使用javascript注释。 But its not working.
但是它不起作用。
And here is my html 这是我的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 ? 有什么建议吗?
I suspect the JS file is not in the directory specified in the annotation. 我怀疑JS文件不在注释中指定的目录中。 Here is an example of project structure demonstrating
@JavaScript
这是一个展示
@JavaScript
的项目结构示例
When you run that example, you should see the following in the browser. 运行该示例时,您应该在浏览器中看到以下内容。
You can find the sample project here: https://github.com/oluwasayo/demo-flow-js 您可以在这里找到示例项目: https : //github.com/oluwasayo/demo-flow-js
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.