Is it possible to “buffer” DOM changes that happen in a loop (to increase performance)?

前端 未结 5 2036
轻奢々
轻奢々 2021-01-06 10:50

To make it clear what I\'m asking, here is my example (fiddle).

I have a list of ~500 random names. I have an input at the top that has live-style searching. On ever

5条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-06 11:05

    Many JS mvvm frameworks such as Reactjs and Vuejs has applied the 'virtual DOM mechanism'.It will batch all DOM updates in one event loop and save you from the penalty of frequent DOM operations.I think you can have a loot at that implementations.

提交回复
热议问题