mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-06-06 15:34:10 +08:00
自动滚到到顶部
This commit is contained in:
parent
a0754cde00
commit
76d3a939d2
@ -1,7 +1,8 @@
|
||||
import React from "react";
|
||||
import { useLayoutEffect } from "react";
|
||||
import { useLocation } from "react-router-dom";
|
||||
|
||||
const AutoScorllTop = ({ children }) => {
|
||||
const AutoScorllTop: React.FC<{ children: any }> = ({ children }) => {
|
||||
const location = useLocation();
|
||||
useLayoutEffect(() => {
|
||||
document.documentElement.scrollTo(0, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user