不蒜子调整
This commit is contained in:
tangly1024
2021-12-21 13:55:42 +08:00
parent e430d55cf8
commit ac7ff2e912
7 changed files with 153 additions and 47 deletions

17
components/Busuanzi.js Normal file
View File

@@ -0,0 +1,17 @@
import busuanzi from '@/lib/busuanzi'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
export default function Busuanzi () {
const router = useRouter()
useEffect(() => {
const busuanziRouteChange = url => {
busuanzi.fetch()
}
router.events.on('routeChangeComplete', busuanziRouteChange)
return () => {
router.events.off('routeChangeComplete', busuanziRouteChange)
}
}, [router.events])
return null
}