封装useGlobal组件,存放全局变量;
新增search页面,修复搜索页无法分页的bug
This commit is contained in:
tangly1024
2021-11-04 13:28:08 +08:00
parent 8f9d3c45e7
commit 4b53a3612c
21 changed files with 214 additions and 169 deletions

View File

@@ -1,6 +1,6 @@
import React, { useCallback, useEffect, useState } from 'react'
import throttle from 'lodash.throttle'
import { useLocale } from '@/lib/locale'
import { useGlobal } from '@/lib/global'
/**
* 跳转到网页顶部
@@ -11,7 +11,7 @@ import { useLocale } from '@/lib/locale'
* @constructor
*/
const JumpToTop = ({ targetRef, showPercent = true }) => {
const locale = useLocale()
const { locale } = useGlobal()
const [show, switchShow] = useState(false)
const [percent, changePercent] = useState(0)
const scrollListener = useCallback(throttle(() => {