-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Open
Labels
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v8.x
Current Behavior
When using the router-link attribute on Ionic Vue components (e.g. <ion-button>, <ion-item>), and passing a Vue Router location object such as:
<ion-button :router-link="{ name: 'details' }">Details</ion-button>
the component navigates correctly, but the generated DOM contains incorrect href values.
Both the host element and the internal Shadow DOM anchor render [object Object] instead of the resolved URL.
Example rendered output:
<ion-button routerlink="[object Object]">
<template shadowrootmode="open">
<a href="[object Object]" class="button-native">
<span class="button-inner">...</span>
</a>
</template>
Details
</ion-button>
This results in:
- Browser status bar showing [object Object] on hover
- Incorrect link preview for assistive technologies
- No way to know the actual target URL from DOM
- Real href never being exposed, navigation works only via JS event interception
Expected Behavior
Ionic should resolve { name: 'details' } into the actual route URL (e.g. /details) and reflect it either:
- on the host element (
routerlink="/details") - or on the internal
<a>element inside Shadow DOM (href="/details")
So that:
- browser hover shows the correct URL
- accessibility tools detect the correct destination
- the link behaves like a normal anchor
- DOM correctly represents the navigation target
Steps to Reproduce
- Create an Ionic Vue project.
- Add a component using router-link with an object:
<ion-button :router-link="{ name: 'details' }">
Details
</ion-button>
- Hover over the component.
- Inspect the DOM.
Result: both the routerlink attribute and the internal <a href> contain [object Object]
Code Reproduction URL
Ionic Info
Ionic:
Ionic CLI : 7.2.1
Ionic Framework : @ionic/vue 8.7.11
Capacitor:
Capacitor CLI : 7.4.4
@capacitor/android : 7.4.4
@capacitor/core : 7.4.4
@capacitor/ios : 7.4.4
Utility:
cordova-res : not installed globally
native-run : 2.0.1
System:
NodeJS : v22.13.1
npm : 10.9.2
OS : Linux 6.8
Additional Information
No response