我有一个尚未发布的完成的Polymer 1应用程序,所以我决定将它升级到Polymer 2。 在bower依赖关系中,我曾经有过
"polymer": "Polymer/polymer#^1.4.0",
"platinum-elements": "PolymerElements/platinum-elements#^2.0.0",
"paper-elements": "PolymerElements/paper-elements#^1.0.7",
"neon-elements": "PolymerElements/neon-elements#^1.0.0",
"iron-elements": "PolymerElements/iron-elements#^1.0.9",
"gold-elements": "PolymerElements/gold-elements#^1.0.1",
"app-route": "PolymerElements/app-route#^1.0.1",
深入挖掘我发现,PolymerElements / paper-elements并没有真正拉下第2版元素。
所以,现在我的凉亭看起来像这样:
"dependencies": {
"polymer": "Polymer/polymer#^2.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0",
"app-route": "PolymerElements/app-route#^2.0.0",
"app-layout": "PolymerElements/app-layout#^2.0.0",
"neon-animation": "PolymerElements/neon-animation#^2.0.0",
"paper-badge": "PolymerElements/paper-badge#^2.0.0",
"paper-behaviors": "PolymerElements/paper-behaviors#^2.0.0",
"paper-button": "PolymerElements/paper-button#^2.0.0",
"paper-card": "PolymerElements/paper-card#^2.0.0",
"paper-checkbox": "PolymerElements/paper-checkbox#^2.0.0",
"paper-dialog": "PolymerElements/paper-dialog#^2.0.0",
"paper-dialog-behavior": "PolymerElements/paper-dialog-behavior#^2.0.0",
"paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^2.0.0",
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^2.0.0",
"paper-fab": "PolymerElements/paper-fab#^2.0.0",
"paper-header-panel": "PolymerElements/paper-header-panel#^2.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^2.0.0",
"paper-input": "PolymerElements/paper-input#^2.0.0",
"paper-item": "PolymerElements/paper-item#^2.0.0",
"paper-listbox": "PolymerElements/paper-listbox#^2.0.0",
"paper-menu-button": "PolymerElements/paper-menu-button#^2.0.0",
"paper-progress": "PolymerElements/paper-progress#^2.0.0",
"paper-radio-button": "PolymerElements/paper-radio-button#^2.0.0",
"paper-radio-group": "PolymerElements/paper-radio-group#^2.0.0",
"paper-ripple": "PolymerElements/paper-ripple#^2.0.0",
"paper-slider": "PolymerElements/paper-slider#^2.0.0",
"paper-spinner": "PolymerElements/paper-spinner#^2.0.0",
"paper-styles": "PolymerElements/paper-styles#^2.0.0",
"paper-swatch-picker": "PolymerElements/paper-swatch-picker#^2.0.0",
"paper-tabs": "PolymerElements/paper-tabs#^2.0.0",
"paper-toast": "PolymerElements/paper-toast#^2.0.0",
"paper-toggle-button": "PolymerElements/paper-toggle-button#^2.0.0",
"paper-tooltip": "PolymerElements/paper-tooltip#^2.0.0",
"iron-a11y-announcer": "PolymerElements/iron-a11y-announcer#^2.0.0",
"iron-a11y-keys": "PolymerElements/iron-a11y-keys#^2.0.0",
"iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^2.0.0",
"iron-ajax": "PolymerElements/iron-ajax#^2.0.0",
"iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^2.0.0",
"iron-behaviors": "PolymerElements/iron-behaviors#^2.0.0",
"iron-collapse": "PolymerElements/iron-collapse#^2.0.0",
"iron-component-page": "PolymerElements/iron-component-page#^2.0.0",
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^2.0.0",
"iron-doc-viewer": "PolymerElements/iron-doc-viewer#^2.0.0",
"iron-dropdown": "PolymerElements/iron-dropdown#^2.0.0",
"iron-fit-behavior": "PolymerElements/iron-fit-behavior#^2.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^2.0.0",
"iron-icon": "PolymerElements/iron-icon#^2.0.0",
"iron-icons": "PolymerElements/iron-icons#^2.0.0",
"iron-iconset": "PolymerElements/iron-iconset#^2.0.0",
"iron-iconset-svg": "PolymerElements/iron-iconset-svg#^2.0.0",
"iron-image": "PolymerElements/iron-image#^2.0.0",
"iron-jsonp-library": "PolymerElements/iron-jsonp-library#^2.0.0",
"iron-list": "PolymerElements/iron-list#^2.0.0",
"iron-location": "PolymerElements/iron-location#^2.0.0",
"iron-media-query": "PolymerElements/iron-media-query#^2.0.0",
"iron-overlay-behavior": "PolymerElements/iron-overlay-behavior#^2.0.0",
"iron-pages": "PolymerElements/iron-pages#^2.0.0",
"iron-swipeable-container": "PolymerElements/iron-swipeable-container#^1.0.3",
"iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#^2.0.0",
"iron-form": "PolymerElements/iron-form#^2.0.0",
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^2.0.0",
"iron-input": "PolymerElements/iron-input#^2.0.0",
"iron-label": "PolymerElements/iron-label#^2.0.0",
"iron-localstorage": "PolymerElements/iron-localstorage#^2.0.0",
"iron-menu-behavior": "PolymerElements/iron-menu-behavior#^2.0.0",
"iron-meta": "PolymerElements/iron-meta#^2.0.0",
"iron-range-behavior": "PolymerElements/iron-range-behavior#^2.0.0",
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^2.0.0",
"iron-scroll-target-behavior": "PolymerElements/iron-scroll-target-behavior#^2.0.0",
"iron-scroll-threshold": "PolymerElements/iron-scroll-threshold#^2.0.0",
"iron-selector": "PolymerElements/iron-selector#^2.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^2.0.0",
"iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#^2.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^2.0.0",
"gold-elements": "PolymerElements/gold-elements#^1.0.1",
"paper-date-picker": "polymer-paper-date-picker#^1.2.0",
"paper-time-picker": "bendavis78/paper-time-picker#^1.1.4",
"paper-password-input": "^2.1.0",
"vaadin-upload": "^2.0.0",
"socket.io-client": "^2.0.3",
"chart.js": "^2.6.0"
},
"ignore": [],
"resolutions": {
"iron-a11y-announcer": "1 - 2",
"webcomponentsjs": "^v1.0.0",
"polymer": "^2.0.0",
"iron-a11y-keys-behavior": "^2.0.0",
"iron-autogrow-textarea": "1 - 2",
"iron-collapse": "^2.0.0",
"iron-behaviors": "^2.0.0",
"iron-fit-behavior": "1 - 2",
"iron-dropdown": "^2.0.0",
"iron-flex-layout": "^2.0.0",
"iron-icon": "1 - 2",
"iron-iconset-svg": "1 - 2",
"iron-image": "^2.0.0",
"iron-media-query": "1 - 2",
"iron-checked-element-behavior": "^2.0.0",
"iron-list": "^2.0.0",
"iron-overlay-behavior": "1 - 2",
"iron-pages": "^2.0.0",
"iron-form-element-behavior": "^2.0.0",
"iron-input": "1 - 2",
"iron-scroll-target-behavior": "^2.0.0",
"iron-menu-behavior": "^2.0.0",
"iron-range-behavior": "1 - 2",
"iron-meta": "^2.0.0",
"iron-resizable-behavior": "^2.0.0",
"iron-selector": "^2.0.0",
"iron-validator-behavior": "^2.0.0",
"iron-validatable-behavior": "^2.0.0",
"paper-button": "^2.0.0",
"paper-icon-button": "^2.0.0",
"paper-input": "^2.0.0",
"paper-progress": "^2.0.0",
"paper-ripple": "^2.0.0",
"paper-styles": "^2.0.0",
"paper-behaviors": "^2.0.0",
"neon-animation": "^2.0.0"
}
我遇到了很多问题。 像这样简单的铁形
<iron-form id="loginForm">
<form action="/" method="POST">
<paper-input name="uid" label="Username" type="text" required auto-validate></paper-input>
<paper-input name="pwd" label="Password" type="password" required auto-validate></paper-input>
<paper-button class="primary" raised on-tap="_submit">Log in
<button type="submit" class="no-style"></button>
</paper-button>
</form>
</iron-form>
我的元素中有哪些
_submit() {
this.$.loginForm.submit();
}
connectedCallback() {
super.connectedCallback();
this.$.loginForm.addEventListener('iron-form-presubmit', function (event) {
event.preventDefault();
myapp.auth.login(this.uid.value, this.pwd.value);
});
}
首先,当我开始输入用户名或密码时,标签不会浮动并显示在用户名后面。
在iron-form上第二次调用.submit()或.validate()会导致'this.inputElement.validate'不是函数'就在这里https://github.com/PolymerElements/paper-input/blob/v2.0.1/paper-input-behavior.html#L437,那是因为this.inputElement未定义。
我错过了什么吗?聚合物-2-starter-kit模板聚合物-cli似乎是针对rc而且很难安装任何UI元素。
感谢。
答案 0 :(得分:0)
建议一次升级一个组件依赖项。并且,请务必阅读更改日志,并注意可能会中断的功能。
答案 1 :(得分:0)
好的,感谢Frank R.我已经开始使用聚合物2-起始剂套装,并根据需要不断添加纸质元素。鲍尔没有要求任何决议(我做了现金清洁)。 这是我现在和工作的凉亭:
"dependencies": {
"polymer": "Polymer/polymer#^2.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0",
"app-layout": "PolymerElements/app-layout#^2.0.0",
"app-route": "PolymerElements/app-route#^2.0.0",
"iron-ajax": "PolymerElements/iron-ajax#^2.0.0",
"iron-collapse": "PolymerElements/iron-collapse#^2.0.0",
"iron-form": "PolymerElements/iron-form#^2.0.0",
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^2.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^2.0.0",
"iron-icon": "PolymerElements/iron-icon#^2.0.0",
"iron-iconset-svg": "PolymerElements/iron-iconset-svg#^2.0.0",
"iron-label": "PolymerElements/iron-label#^2.0.0",
"iron-list": "PolymerElements/iron-list#^2.0.0",
"iron-media-query": "PolymerElements/iron-media-query#^2.0.0",
"iron-pages": "PolymerElements/iron-pages#^2.0.0",
"iron-selector": "PolymerElements/iron-selector#^2.0.0",
"paper-badge": "PolymerElements/paper-badge#^2.0.0",
"paper-button": "PolymerElements/paper-button#^2.0.0",
"paper-checkbox": "PolymerElements/paper-checkbox#^2.0.0",
"paper-dialog": "PolymerElements/paper-dialog#^2.0.0",
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^2.0.0",
"paper-fab": "PolymerElements/paper-fab#^2.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^2.0.0",
"paper-input": "PolymerElements/paper-input#^2.0.0",
"paper-item": "PolymerElements/paper-item#^2.0.0",
"paper-listbox": "PolymerElements/paper-listbox#^2.0.0",
"paper-toast": "PolymerElements/paper-toast#^2.0.0",
"paper-tooltip": "PolymerElements/paper-tooltip#^2.0.0",
"paper-password-input": "^2.1.0",
"vaadin-upload": "^2.0.0",
"socket.io-client": "^2.0.3",
"chart.js": "^2.6.0"
},