Navigation Duplicated in Nuxt.js

huangapple go评论53阅读模式
英文:

Navigation Duplicated in Nuxt.js

问题

NavigationDuplicated: 避免冗余导航到当前位置:"/haendler-details/1404-distilled-gin"

英文:

In my project I have set up a simple nuxt2 with routing but when page refresh it show the error.

NavigationDuplicated: Avoided redundant navigation to current location:
"/haendler-details/1404-distilled-gin"

答案1

得分: 2

这个错误基本上是因为你导航到相同的路由而发生的。
为了避免这个错误,你可以在nuxt-link上使用exact关键字。

<nuxt-link to="/here-the-path" exact>前往蒸馏杜松子酒</nuxt-link>
英文:

This error basically occurs because the you navigate the same route.
So avoid this error you can used exact keyword on nuxt-link

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

&lt;nuxt-link to=&quot;/here-the-path&quot; exact&gt;Go to Distilled Gin&lt;/nuxt-link&gt;

<!-- end snippet -->

huangapple
  • 本文由 发表于 2023年7月17日 14:14:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76701889.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定