-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Array rendering re-paint if append elements to head
Render function:
<ul>
<li each="todo in state.todos">{{ todo }}</li>
</ul>Unshift on array state will cause repaint entire the <ul> div:
function addTodo() {
state.todos.unshift(state.text)
state.text = ''
}The same will happen for state.todo[1] = 'Text' and any other operations on array state.
How to solve: Use key for each item, improve the diff for arrays
Metadata
Metadata
Labels
help wantedExtra attention is neededExtra attention is needed