1 使用闭包 达到防抖的效果 2 window.onresize = () => { 3 flagNumber++; 4 (function(flag){ 5 setTimeout(() => { 6 if(flag==flagNumber){ 7 dispatch({ type: ‘changeNavbar‘ }) 8 } 9 }, 100) 10 })(flagNumber) 11 };
标签:color 效果 ++ bar == div log lag gen
1 使用闭包 达到防抖的效果 2 window.onresize = () => { 3 flagNumber++; 4 (function(flag){ 5 setTimeout(() => { 6 if(flag==flagNumber){ 7 dispatch({ type: ‘changeNavbar‘ }) 8 } 9 }, 100) 10 })(flagNumber) 11 };
标签:color 效果 ++ bar == div log lag gen
原文地址:https://www.cnblogs.com/tutu-binbin/p/8603350.html