Nuxt.js: Anchors

Created on 6 Feb 2018  路  9Comments  路  Source: nuxt/nuxt.js

I have issues with anchors
a link to "/#div" display the target page
but the id is not targeted.

Instead, the scroll position is the same of the previous page for example

This question is available on Nuxt.js community (#c2412)

Most helpful comment

Hi @Atinux I just tried the latest release of v1.4.0, this issue is still happening.

All 9 comments

I don't know if it was fixed, but the vue-router was looking for the el before the new page is rendered.

@pi0 Could you comment this?
https://github.com/nuxt/nuxt.js/issues/723#issuecomment-302451686

Hi @DevDom05

What version of Nuxt.js are you using?

I can reproduce after upgrading to 1.3.0 from 1.0.0-gh-adc7260. It works fine on 1.0.0-gh-adc7260.

Hi @Atinux I just tried the latest release of v1.4.0, this issue is still happening.

I have the same issue on v1.4.0

A working work-around fix of using a custom scrollBehavior in route option in nuxt.config.js: https://github.com/nuxt/nuxt.js/issues/2738#issuecomment-372007743.

This question has been resolved by @onlyurei, see answer.

@onlyurei , this work-around works bad. There is jumping scroll glitch after click on nuxt-link. Problem with internal anchor links not solved, inpage navigation with anchors should work out of the box.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vadimsg picture vadimsg  路  3Comments

msudgh picture msudgh  路  3Comments

vadimsg picture vadimsg  路  3Comments

danieloprado picture danieloprado  路  3Comments

jaredreich picture jaredreich  路  3Comments