代码就像下面的工作正常Chrome,但在Firefox我使用聚合物时,遇到下列错误1.9.1DOM,如果在Firefox不能使用的功能“如果”价值
[未定义:: _annotatedComputationEffect]:计算方法hasMoreData
没有定义
<template>
<template is="dom-repeat" items="[[sections]]">
<div>
<template is="dom-if" if="{{hasMoreData(item)}}">
<div name="loadMore">load more</div>
</template>
</div>
</template>
</template>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: 'listing-collection',
//...other stuff...
hasMoreData: function(item) {
return true;
}
});
});
</script>
这是很无奈的是一些基本的东西似乎不工作的文件说,在一个特定的新版浏览器,而在另一个正常工作的方式。像这样的东西:(让我担心在生产中使用的聚合物。我面临其他跨浏览器的问题,但他们身边工作,但这次我觉得框架终于把我推在边缘:)
您使用两个范围,所以你不能得到这个功能。尝试发送它像一个道具从重复模板,如项目 – Dmitry
谢谢你的答复。你能告诉我一个例子代码中的“你的意思是把它像道具一样从重复的模板中像道具一样发送出去”吗? – lee
我很抱歉,这是我的错误。我检查了你的方法,如果我们没有使用'HTMLImports.whenReady'回调就可以正常工作,因为它在'webcomponents'准备好之前就被触发了。 [了解更多关于它(http://stackoverflow.com/questions/37017594/what-is-the-difference-between-htmlimports-whenready-and-window-addeventliste) – Dmitry