W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
nuxt-link 組件用于在頁面中添加鏈接至別的頁面。
目前 <nuxt-link> 的作用和 <router-link> 一致,推薦閱讀 Vue路由文檔 來了解它的使用方法。
例如 (pages/index.vue):
<template>
<div>
<h1>Home page</h1>
<nuxt-link to="/about">關于</nuxt-link>
</div>
</template>
別名: <n-link>, <NuxtLink>, 和 <NLink>
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全局設置此功能。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: