Nuxt-link and router-link don’t create href attribute


  • nuxt: 2.12
  • node: 13.7


Additional Details

Href attribute is not attached to ” tag during SSR if ‘href’ was passed as not defined prop.

Steps to reproduce

Serve reproduction repo, inspect the source code.


source code from devtools’ network tab

document ready

What is Expected?

Passing not defined dynamic prop to ” should not cause href loss in SSR mode.

What is actually happening?

Href attribute appears after browser render.

Author: Fantashit

1 thought on “Nuxt-link and router-link don’t create href attribute

  1. No, i expect the behavior of :href="undefined" and no href prop at all to be equal. So you can use this component


    either with props {tag: 'a', href: '', target: '_blank'} and with {tag: 'n-link', to: '/home'} and get href attribute already existing in page source code in both cases

Comments are closed.