Nuxt.js: Plain html links <a> reloads the app

Created on 4 Oct 2017  路  3Comments  路  Source: nuxt/nuxt.js

Hi!

I created a blog platform. User creates documents inside wysiwyg editor (tinymce).
Very often inside the article users adds links to other articles <a href="/some-other-article">Link</a>

The problem is that the <a> tags reloads the whole app :(
How can I handle it the force <a> to behave like a <nuxt-link>?

Thanks for help in advance,

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

Most helpful comment

@awronski you may want to take a look at this: https://github.com/nuxt/nuxtjs.org/blob/master/components/HtmlParser.vue

Mostly on addListeners method.

All 3 comments

You need to use nuxt-link not a.
But this will lead you to multiple issues.
I also had the task to use components from API data, but drop that idea. To complicated.

@awronski you may want to take a look at this: https://github.com/nuxt/nuxtjs.org/blob/master/components/HtmlParser.vue

Mostly on addListeners method.

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

msudgh picture msudgh  路  3Comments

uptownhr picture uptownhr  路  3Comments

vadimsg picture vadimsg  路  3Comments

jaredreich picture jaredreich  路  3Comments

danieloprado picture danieloprado  路  3Comments