Polymer 聚合:dom重复项目-是否可以洗牌重复项目?
在Polymer template:dom repeat items中-是否可以洗牌重复项目?是的,使用排序函数将随机分配项目位置,而不是实际排序Polymer 聚合:dom重复项目-是否可以洗牌重复项目?,polymer,polymer-1.0,polymer-starter-kit,firebase-polymer,Polymer,Polymer 1.0,Polymer Starter Kit,Firebase Polymer,在Polymer template:dom repeat items中-是否可以洗牌重复项目?是的,使用排序函数将随机分配项目位置,而不是实际排序 <template is="dom-repeat" items="[[items]]" sort="_sortItems" initial-count="1"> <a href$="#[[section]]/[[item.id]]" class="item" aria-label$="More information a
<template is="dom-repeat" items="[[items]]" sort="_sortItems" initial-count="1">
<a href$="#[[section]]/[[item.id]]" class="item" aria-label$="More information about [[item.title]]">
<shrine-item item="[[item]]"></shrine-item>
</a>
</template>
_sortItems: function() {
return Math.round(Math.random()*3) - 1;
}
_sortItems:function(){
返回Math.round(Math.random()*3)-1;
}