Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Vue-router named route not working #55

Open
2 tasks done
toshoajibade opened this issue Jan 19, 2023 · 2 comments
Open
2 tasks done

Vue-router named route not working #55

toshoajibade opened this issue Jan 19, 2023 · 2 comments

Comments

@toshoajibade
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.11.0

Plugin version

0.1.0

Node.js version

16.3.1

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

MacOS Ventura 13.1

Description

Navigating using vue-router named route is not working both during programmatic navigation and when using RouterLink component. This is because the name of the route is not passed when creating the routes here, https://github.com/fastify/fastify-dx/blob/main/packages/fastify-vue/virtual/routes.js#L33.

To fix, I will suggest adding name: routeDef.name here.

I can open a PR for this.

Steps to Reproduce

  • Clone fastify-dx/vue starter template
  • In the index.vue file, change the RouterLink component to use a named route instead of a path.

Expected Behavior

The application should navigate to a new route

@galvez
Copy link
Member

galvez commented Jan 19, 2023

That would be highly appreciated — the routing system needs some touches.

@toshoajibade
Copy link
Author

I will do that. Thanks for the amazing work. This package has been a life saver for a project I am working on. 🙏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants