Aurelia array observation doesn't react on array[index] = newItem

我是研究僧i 提交于 2019-12-25 04:24:43

问题


I use surprised why my repeat.for binding doesn't react on array change. Then I found out Aurelia array observation doesn't react on array[index] = newItem.

This is confirmed when I read the spec https://github.com/aurelia/binding/blob/master/test/array-observation.spec.js

The array observation only reacts on methods pop/push/reverse/shift/sort/splice/unshift. Replacing the whole array works too.

I can fix my issue with splice instead of using array[index] = newItem;

But I would like to know is it technically too difficult to react on array[index] = newItem for Aurelia array observation?


回答1:


This is offcially unsupported in Aurelia.

https://github.com/aurelia/binding/issues/509



来源:https://stackoverflow.com/questions/39501250/aurelia-array-observation-doesnt-react-on-arrayindex-newitem

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