路径更改时 Polymerfire 查询不返回新数据

Polymerfire query is not returning new data when path changed

这里是 Youtube link 问题

我正在尝试使用 firebase-query 更改路径,如下所示

<firebase-query
        id="query"
        log
        order-by-child="name"
        app-name="appname1"
        path="/posts/[[collectionPath]]"
        data="{{posts}}">
</firebase-query> 

以下是我的数据结构

Polymer({

  is: 'my-view2',

  properties: {
      collectionPath: {
      type: String,
      value: "",
      notify: true
    }
  },
  updatePath:function (selectedTab) {
    this.set('collectionPath', selectedTab);        
  }
});

在选项卡上单击我正在调用函数 updatePath(),例如 updatePath('Android')

但是当路径更改时,查询没有 returning 新数据。当我重新加载应用程序时,它 return 我的数据。请帮忙

终于自己做了,分享给大家

只需将路径设置为 null 即 this.$.query.path = null; 如下代码

updatePath:function (selectedTab) {
  this.$.query.path = null;
  this.set('collectionPath', selectedTab);        
}