How can I refresh/reload Polymer element, when page changes?

…衆ロ難τιáo~ 提交于 2019-12-03 16:19:38

I found a solution. But, it's a little bit tricky. First, I added a function called isEqual.

app.isEqual = function(x, y) {
  return x === y;
};

And, used dom-if.

<section data-route="groups">
  <template is="dom-if" if="{{isEqual(route, 'groups')}}" restamp="true">
    <tend-groups-joined></tend-groups-joined>
  </template>
</section>

So, basically it compares the current route with a string parameter I pass, if it matches it restamps. A little bit tricky, but it worked.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!