fix: add meta in _app

This commit is contained in:
fantasticit 2022-04-04 21:54:35 +08:00
parent e90330ad9d
commit 537b114f17
2 changed files with 9 additions and 16 deletions

View File

@ -1,4 +1,5 @@
import type { AppProps } from 'next/app';
import Head from 'next/head';
import { useSafari100vh } from 'hooks/use-safari-100vh';
import 'viewerjs/dist/viewer.css';
import 'styles/globals.scss';
@ -7,7 +8,14 @@ import 'tiptap/styles/index.scss';
function MyApp({ Component, pageProps }: AppProps) {
useSafari100vh();
return <Component {...pageProps} />;
return (
<>
<Head>
<meta name="viewport" content="viewport-fit=cover" />
</Head>
<Component {...pageProps} />
</>
);
}
export default MyApp;

View File

@ -1,15 +0,0 @@
import { Html, Head, Main, NextScript } from 'next/document';
export default function Document() {
return (
<Html>
<Head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}