Description
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
Activity