Dynamic update of dom-repeat templates by changing the underlying array

前端 未结 1 1146
梦如初夏
梦如初夏 2021-02-20 07:53

Is there a Polymer dom api method or other ways to automatically update the repeated template with additional elements, should the underlying array gets updated?

I have

1条回答
  •  感情败类
    2021-02-20 08:19

    If you update the array with this.push('myarray', {item}); then that will trigger Polymer's binding observers. More info is in the documentation at https://www.polymer-project.org/1.0/docs/devguide/properties#array-mutation

    0 讨论(0)
提交回复
热议问题