angular.js - vue/react rendering content jitters
滿天的星座
滿天的星座 2017-05-15 17:06:43
0
3
729

vue/react/angular framework, etc. When rendering data, the page jitters, giving users an unfriendly feeling. How to eliminate this jitter?

滿天的星座
滿天的星座

reply all(3)
巴扎黑

The first method is to place a loading prompt in the rendered area in advance, hide/delete the loading after rendering, and display normal content.

The second method is to give the data an initial value, which can support the page style, and then replace it after obtaining it.

The transformation of the second method starts from CSS, so that the unrendered part can be displayed and the structure is consistent with that after rendering. After rendering is completed, only the corresponding data is changed, and the page structure is not changed.

迷茫

Using ng-cloakv-cloak, I have never been exposed to React so I don’t know.

漂亮男人

In addition to the solution in the first answer, you can also consider isomorphism. Reactjs provides such a solution. The output of nodejs is the formed page. There is no need for the client to rerender once, and there is no problem of flashing.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template