Polymer 未捕获类型错误:此。$.selector.clearSelection不是函数
这是我的布局。没有铁名单,它工作,但它给我的错误 未捕获类型错误:此。$.selector.clearSelection不是函数Polymer 未捕获类型错误:此。$.selector.clearSelection不是函数,polymer,Polymer,这是我的布局。没有铁名单,它工作,但它给我的错误 未捕获类型错误:此。$.selector.clearSelection不是函数 调试表明选择器中确实没有这样的函数。这个选择器实际上是聚合物库中的数组选择器元素。它在源代码中有这样的功能。好的,我已经找到了原因。他们在1.0.9和1.1.1之间更改了API。我的聚合物版本是1.0.9,这就是它不起作用的原因。 我已将所有聚合物元素更新为最新版本,现在可以使用了。如果您能做一个现场演示就更好了。我同意,请向我们展示您的代码,以便我们可以帮助您。@F
调试表明选择器中确实没有这样的函数。这个选择器实际上是聚合物库中的数组选择器元素。它在源代码中有这样的功能。好的,我已经找到了原因。他们在1.0.9和1.1.1之间更改了API。我的聚合物版本是1.0.9,这就是它不起作用的原因。
我已将所有聚合物元素更新为最新版本,现在可以使用了。如果您能做一个现场演示就更好了。我同意,请向我们展示您的代码,以便我们可以帮助您。@Flavio Ochoa-您可以看到所有的代码。我不知道如何制作聚合物代码的现场演示。
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/paper-input/paper-input.html">
<link rel="import" href="../common-settings-service/common-settings-service.html">
<link rel="import" href="../bower_components/paper-button/paper-button.html"/>
<link rel="import" href="../bower_components/paper-material/paper-material.html"/>
<link rel="import" href="../bower_components/iron-list/iron-list.html">
<link rel="import" href="../bower_components/iron-flex-layout/iron-flex-layout.html">
<dom-module id="common-settings">
<style>
:host {
display: block;
}
paper-material {
background: #FFFFFF;
}
.container {
@apply(--layout-horizontal);
}
.windowItem {
@apply(--layout-horizontal);
}
.list {
@apply(--layout-flex);
@apply(--layout-vertical);
}
.item {
@apply(--layout-horizontal);
margin: 16px 16px 0 16px;
padding: 20px;
border-radius: 8px;
background-color: white;
border: 1px solid #ddd;
}
</style>
<template>
<common-settings-service
id="commonSettings"
url="/board_service/common_settings/"
settings="{{settings}}"/>
<paper-material elevation="1">
<div class="container">
<h3> Настройки обработки</h3>
<h4>Окна</h4>
<div class="list">
<iron-list items="[[settings.timeWindows]]" as="item">
<template>
<div class="item">
Name: <span>[[item]]</span>
</div>
</template>
</iron-list>
</div>
clearSelection: function() {
function unselect(item) {
var model = this._getModelFromItem(item);
if (model) {
model[this.selectedAs] = false;
}
}
if (Array.isArray(this.selectedItems)) {
this.selectedItems.forEach(unselect, this);
} else if (this.selectedItem) {
unselect.call(this, this.selectedItem);
}
this.$.selector.clearSelection();
},