博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
next. js_Next.js添加到您的应用程序中的图标
阅读量:2506 次
发布时间:2019-05-11

本文共 1716 字,大约阅读时间需要 5 分钟。

next. js

When working on a Next.js app, do you see that little icon at the bottom right of the page, which looks like a lightning?

在使用Next.js应用程序时,您是否在页面右下方看到一个小图标,看起来像闪电?

If you hover it, it’s going to say “Prerendered page”:

如果将其悬停,它将显示“ Prerendered page”:

This icon, which is only visible in development mode of course, tells you the page qualifies for automatic static optimization, which basically means that it does not depend on data that needs to be fetched at invokation time, and it can be prerendered and built as a static HTML file at build time (when we run npm run build).

该图标( 仅在开发模式下才可见)告诉您该页面符合自动静态优化的条件,这基本上意味着该页面不依赖于在调用时需要获取的数据,并且可以按以下方式进行预渲染和构建:在构建时(当我们运行npm run build )的静态HTML文件。

Next can determine this by the absence of the getInitialProps() method attached to the page component.

Next可以通过缺少附加到页面组件的getInitialProps()方法来确定这一点。

When this is the case, our page can be even faster because it will be served statically as an HTML file rather than going through the Node.js server that generates the HTML output.

在这种情况下,我们的页面甚至可以更快,因为它将作为HTML文件静态提供,而不是通过生成HTML输出的Node.js服务器提供。

Another useful icon that might appear next to it, or instead of it on non-prerended pages, is a little animated triangle:

可能会出现在它旁边的另一个有用图标,或者代替它出现在非优先页面上的是一个动画三角形:

This is a compilation indicator, and appears when you save a page and Next.js is compiling the application before hot code reloading kicks in to reload the code in the application automatically.

这是一个编译指示符,当您保存页面并且Next.js正在编译应用程序之前,此提示会在热代码重新加载开始之前自动显示在应用程序中。

It’s a really nice way to immediately determine if the app has already been compiled and you can test a part of it you’re working on.

这是一种非常好的方法,可以立即确定该应用程序是否已被编译,并且您可以测试正在处理的应用程序的一部分。

翻译自:

next. js

转载地址:http://tlqgb.baihongyu.com/

你可能感兴趣的文章
JavaScript运算符
查看>>
html position布局
查看>>
VTP
查看>>
Linux内核分析第一周——计算机是如何工作的
查看>>
Windows 自动启动 bat
查看>>
不规则按钮,支持普通Button,Radio Button, Check Button
查看>>
【C语言】模拟实现库函数strcat函数
查看>>
用newLISP读取Hive的元数据
查看>>
模式识别 - libsvm该函数的调用方法 详细说明
查看>>
数据库启动(下一个)
查看>>
FineUI第九天---表单验证
查看>>
Unity3D 快捷键
查看>>
Springboot集成WebSocket通信全部代码,即扣即用。
查看>>
接口,lambda表达式与内部类
查看>>
【poj1009】 Edge Detection
查看>>
去掉PowerDesigner生成SQL脚本中字段名带的引号
查看>>
win10操作系统安装oracle11g时出现不满足最低配置的操作INS13001
查看>>
java基础学习——7、String类和StringBuffer类的区别
查看>>
js基础
查看>>
sklearn 中 make_blobs模块
查看>>