🎈 perf(购物页面): 添加节流

This commit is contained in:
xuan
2022-12-02 10:33:51 +08:00
parent 6a1cd2b2ed
commit ba4f0e68ce
4 changed files with 2610 additions and 3923 deletions
+2 -2
View File
@@ -62,10 +62,10 @@ const ShoppingCartContainer: FC = () => {
}, [searchOptions])
// 输入了搜索关键字
const getSearchData = useCallback((e) => {
const getSearchData = useCallback(debounce((e) => {
console.log('getSearchData===>', e)
setSearchOptions({ short_name_or_phone: e })
}, [])
}, 300), [])
const [shoppingCartData, setShoppingCartData] = useState<{
list: ShoppingCartData[]