簡體   English   中英

Nuxt.js 和錨點

[英]Nuxt.js and anchors

如何處理 Nuxt.js 中的錨點(在同一頁面內)?

問題是 URL 始終保持在基礎localhost:3000/我也希望在 URL 上顯示錨點: localhost:3000/#anchor1localhost:3000/#anchor2localhost:3000/#anchor3 ......等等。

似乎<nuxt-link :to=(/#anchorid)> Inner link </nuxt-link>不能完成這項工作。

如何實現這個功能?

如果使用locales

<nuxt-link 
  :to="localePath({ name: 'index', hash: '#anchor1'})" 
  v-text="Anchor 1" 
  alt="Anchor 1">
</nuxt-link>

別的

<nuxt-link to="/anchor1" v-text="Anchor 1" />

如何處理Nuxt.js中的錨點(在同一頁面中)?

問題是URL始終保持在基本localhost:3000/我也想在URL上顯示錨點: localhost:3000/#anchor1localhost:3000/#anchor2localhost:3000/#anchor3 …等等。

似乎<nuxt-link :to=(/#anchorid)> Inner link </nuxt-link>不能完成該工作。

如何實現此功能?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM