Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MenuItem: type of to should be RouteLocationRaw #1933

Closed
LorianColtof opened this issue Dec 29, 2021 · 0 comments · Fixed by #1934
Closed

MenuItem: type of to should be RouteLocationRaw #1933

LorianColtof opened this issue Dec 29, 2021 · 0 comments · Fixed by #1934
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@LorianColtof
Copy link
Contributor

I'm submitting a ... (check one with "x")

[x] bug report 
[ ] feature request
[ ] support request

CodeSandbox Case (Bug Reports)
(TypeScript)
The to field on <router-link> allows for more than just string paths, e.g. named routes.
The type of the to field on MenuItem currently does not allow this because it is string:

const test: MenuItem = {
  label: 'Test',
  to: { name: 'my-named-route' },
};

Current behavior
The type is string, and does thus not allow having named routes as in the example above.

Expected behavior
The type should be RouteLocationRaw, which aligns with the type of the to field on <router-link>: https://github.com/vuejs/vue-router-next/blob/master/src/RouterLink.ts#L45

Minimal reproduction of the problem with instructions
See above

What is the motivation / use case for changing the behavior?
Improved TypeScript support for the MenuModel.

Please tell us about your environment:
Vue CLI with TypeScript

  • Vue version: 3.X

  • PrimeVue version: 3.10.0

  • Browser: all

@tugcekucukoglu tugcekucukoglu self-assigned this Jan 11, 2022
@tugcekucukoglu tugcekucukoglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jan 11, 2022
@tugcekucukoglu tugcekucukoglu added this to the 3.10.1 milestone Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants