[SOLVED][nuxt3][quasar] Get Union Type of Routes Paths #193
-
Hi, I'm using Nuxt 3 with I'm trying to find if there's an union type of all the routes paths, So for example: <script setup lang="ts">
import {QBtnProps} from 'quasar'
import { RoutePathUnion } from 'vue-router/auto'
interface AppBtn extends Omit<QBtnProps, "color"> {
color?: "primary" | "secondary" | "negative"
to?: RoutePathUnion
}
const props = defineProps<AppBtn>()
</script>
<template>
<QBtn :color="props.color"></QBtn>
</template>
<style scoped>
</style> And then having completion in Is there something like this, or is there a way I can implement this using |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
SolvedHaha thaaaanks Nuxt team! type Routes = Parameters<typeof navigateTo>[0]
interface AppBtn extends Omit<QBtnProps, "color"> {
color?: "primary" | "secondary" | "negative"
to?: Routes
} |
Beta Was this translation helpful? Give feedback.
-
I never added the actual answer: these types are exported from |
Beta Was this translation helpful? Give feedback.
I never added the actual answer: these types are exported from
vue-router/auto
. See #209 (comment)