Description
Vue version
3.4.21
Link to minimal reproduction
Steps to reproduce
- Inspect the
a
tag in the DOM
What is expected?
The username
and password
attributes fall-through to the underlying a
element in the DOM like in vanilla-HTML.
Here's an example fiddle showcasing what I was expected: https://codepen.io/Ross-Alexandra/pen/VwNagGR. If you inspect the a
here, you'll see the username
, password
, and some-other-attribute
attributes directly in the DOM.
What is actually happening?
The username
& password
attributes are being consumed, and prepended to the href
as the authentication-part of the URL (ex: <a href="https://foobar:[email protected]">
is being rendered instead of <a href="https://www.google.com" username="foobar" password="baz">
).
System Info
No response
Any additional comments?
I ran into this during a migration from Vue 2.7 to Vue 3.1. At some point when our codebase was still on Vue 2.x, we made a refactor which caused one of our components to no longer accept a username
prop. This refactor wasn't properly completed however, as some of the references to that component were still passed a username
. The root of that component is an a
tag, so the username
prop being passed to the component fell through to an attribute on the underlying a
tag. This bug was then encountered, as that username attribute was prepended onto the href
.
If this is working as intended, I was unable to find any documentation pointing this out.