-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Reproduction
https://github.com/OwenVey/vue-router-int-parser
Steps to reproduce the bug
I have a route file [id=int].vue and route.params.id has a type of number but when I log it or log the typeof I am seeing that it is actually a string.
My vite.config.ts file looks like:
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
import VueRouter from 'vue-router/vite'
// https://vite.dev/config/
export default defineConfig({
plugins: [
VueRouter({
dts: './src/route-map.d.ts',
experimental: {
paramParsers: true
}
}),
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
})Expected behavior
The value of route.params.id should be a number
Actual behavior
The value of route.params.id is a string
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels