0

我对聚合物很陌生,我正在尝试在polymer2.0上使用它

但无法正确集成演示中给出的脚本

document.addEventListener('WebComponentsReady', function() {
Polymer({
  is: 'custom-expansion',
  ready: function() {
    var table = Polymer.dom(this).querySelector('iron-data-table');
    var expandedItem;
    table.addEventListener('expanding-item', function(e) {
      if (expandedItem) {
        table.collapseItem(expandedItem);
      }
      expandedItem = e.detail.item;
    });
  }
});   });

我的代码结构是这样的

class AllCourses extends Polymer.Element {
static get is() { return 'all-course'; }
static get properties() {} }

谢谢你。

4

0 回答 0