| | |
| | | import { Inter } from "next/font/google"; |
| | | import "./globals.css"; |
| | | import ClientLayoutContent from '@/components/layout/ClientLayoutContent'; |
| | | import Script from 'next/script'; |
| | | |
| | | const inter = Inter({ subsets: ["latin"] }); |
| | | |
| | |
| | | }, |
| | | }; |
| | | |
| | | const ScrollToTop = () => { |
| | | return ( |
| | | <Script id="scroll-to-top"> |
| | | {` |
| | | if (typeof window !== 'undefined') { |
| | | window.onload = function() { |
| | | window.scrollTo(0, 0); |
| | | } |
| | | } |
| | | `} |
| | | </Script> |
| | | ); |
| | | }; |
| | | |
| | | export default function RootLayout({ |
| | | children, |
| | | }: { |
| | |
| | | }) { |
| | | return ( |
| | | <html lang="zh-CN" className="smooth-scroll"> |
| | | <ScrollToTop /> |
| | | <body className={`${inter.className} overflow-x-hidden`}> |
| | | <ClientLayoutContent>{children}</ClientLayoutContent> |
| | | </body> |