当我使用 npx create-next-app
创建 Next.js 项目时命令比有一个 _app.js
pages
下的文件文件夹。在哪种情况下,我需要在 Next.js 项目中为文件添加下划线前缀?
最佳答案
App
Next.js 使用
App
用于初始化页面的组件。To override the default
App
, create the file./pages/_app.js
Document
定制
Document
通常用于增强应用程序的 <html>
和 <body>
标签。To override the default
Document
, create the file./pages/_document.js
关于next.js - 为什么 Next.js 在 app.js 前面加上下划线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65857281/