1

我对加载聚合物元素有疑问。当我配置我的bower.json文件依赖项时没有正确加载。

这是我的 bower.json 文件:

{
  "name": "Example",
  "description": "Example",
  "version": "1.0.0",
  "license": "https://vaadin.com/license/cvtl-1",
  "authors": [
    "Vaadin Ltd"
  ],
  "dependencies": {
    "iron-flex-layout": "PolymerElements/iron-flex-layout#^2.0.0",
    "iron-form": "PolymerElements/iron-form#^2.0.0",
    "iron-media-query": "PolymerElements/iron-media-query#^2.0.0",
    "polymer": "Polymer/polymer#^2.0.0",
    "webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0",
    "iron-icon": "^2.0.0",
    "paper-toast": "^2.0.0",
    "vaadin": "vaadin/vaadin#10.0.0-alpha8",
    "vaadin-grid": "vaadin/vaadin-grid#4.1.0-beta1",
    "vaadin-charts": "vaadin/vaadin-charts#6.0.0-alpha10",
    "vaadin-valo-theme": "vaadin/vaadin-valo-theme#2.0.0-alpha5",
    "vaadin-tabs": "^1.0.0",
    "app-layout": "polymerelements/app-layout#2.1.0"
    // "wysiwyg-e" : "^2.1.3"
  },
  "devDependencies": {
    "web-component-tester": "Polymer/web-component-tester#^6.0.0"
  },
  "private": true,
  "resolutions": {
    "vaadin-grid": "4.1.0-beta1",
    "vaadin-charts": "6.0.0-alpha10",
    "vaadin-valo-theme": "2.0.0-alpha5"
  }
}

我需要正确加载app-layoutwysiwyg-e. 我做错了什么 ?有什么建议吗?

4

2 回答 2

0

通过查看您从同一目录加载的其他依赖项,我会说路径区分大小写,并且app-layout您只使用小写字母,而不是 PascalCase 格式,所以也许您应该尝试:

"app-layout": "PolymerElements/app-layout#2.0.1",

(我猜你的意思是 2.0.1,而不是 2.1.0,因为 2.0.5 似乎是最新版本)

wysiwyg-e可以试试:

"wysiwyg-e": "miztroh/wysiwyg-e#^2.1.3"
于 2018-04-30T07:09:02.740 回答
0

与此类 bower.json 文件版本冲突的原因是各个 Vaadin 组件(vaadin-gridvaadin-charts等)被有效地包含了两次:一次通过vaadin/vaadin元包,第二次显式包含。

一般来说,只对vaadin元包有一个凉亭依赖就足够了:

"dependencies": {
  "iron-flex-layout": "PolymerElements/iron-flex-layout#^2.0.0",
  "iron-form": "PolymerElements/iron-form#^2.0.0",
  "iron-media-query": "PolymerElements/iron-media-query#^2.0.0",
  "polymer": "Polymer/polymer#^2.0.0",
  "webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0",
  "iron-icon": "^2.0.0",
  "paper-toast": "^2.0.0",
  "vaadin": "vaadin/vaadin#10.0.0-alpha8",
  "wysiwyg-e": "^2.1.3"
},
"devDependencies": {
  "web-component-tester": "Polymer/web-component-tester#^6.0.0"
}

这将拉取一组匹配的 、 和所有其他 Vaadin 组件的vaadin-grid版本vaadin-charts

另请注意,您似乎使用的是过时的 alpha8 版本。请考虑升级到最新的测试版:vaadin/vaadin#10.0.0-beta8.

如果您确实需要使用 say 的特定版本vaadin-grid,则方法是根本使用vaadin元依赖项,或者指定包含所需版本的它的版本vaadin-grid(例如vaadin-grid#4.1.0-alpha1vaadin#10.0.0-alpha5,但没有vaadin包含 ) 版本的元包4.1.0-beta1版本vaadin-grid

于 2018-04-30T07:11:02.667 回答