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