相关文章推荐

Nuxt.js v2.4.0 添加

为了提高 Nuxt.js 应用程序的响应能力,当链接将显示在视口中时,Nuxt.js 将自动预获取代码分割页面。此功能的灵感来自 Google Chrome Labs 的 quicklink.js

要禁用链接页面的预获取,可以使用 no-prefetch

<n-link to="/about" no-prefetch>About page not pre-fetched</n-link>

您可以使用router.prefetchLinks全局配置此行为。

关于prefetched-class还可用于自定义在预获取代码分割页面时添加的类。确保使用router.linkPrefetchedClass全局设置此功能。

 
推荐文章