angular.js - The page needs to be filled with js to fill the width. When the ui-router is switched, the page will flicker. How to solve it?
阿神2017-05-16 13:19:47
0
3
788
The page needs to be filled with js to fill the width. When ui-router switches, you will see the page flickering. It should be js running. Is there a way to make js execute first and then display the page to eliminate the flickering
Simply, you can set a flag bit at the end of js execution, and then you can associate this flag bit through the ng-if/ng-show command to control the display of page elements. If it is more complicated, you can refer to the official Wiki to set the switching animation of ui-view
You can set a mask layer with 100% height and width first, and then set the mask to display:none after the real page is switched.
Simply, you can set a flag bit at the end of js execution, and then you can associate this flag bit through the ng-if/ng-show command to control the display of page elements. If it is more complicated, you can refer to the official Wiki to set the switching animation of ui-view
When binding, use ng-bind to bind, or use ng-cloak to process, you can take a look at it in detail