int paramParser not modifying value
#2622
Answered
by
posva
OwenVey
asked this question in
Help and Questions
-
Reproductionhttps://github.com/OwenVey/vue-router-int-parser Steps to reproduce the bugI have a route file My 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 behaviorThe value of Actual behaviorThe value of Additional informationNo response |
Beta Was this translation helpful? Give feedback.
Answered by
posva
Feb 11, 2026
Replies: 1 comment 2 replies
-
|
You need to use the experimental router: import { createWebHistory } from 'vue-router'
import { experimental_createRouter as createRouter } from 'vue-router/experimental'
import { handleHotUpdate, resolver } from 'vue-router/auto-resolver'
export const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
resolver,
})
if (import.meta.hot) {
handleHotUpdate(router)
}And also manually register RouterLink and RouterView in import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { RouterLink, RouterView } from 'vue-router'
const app = createApp(App)
app.component('RouterLink', RouterLink)
app.component('RouterView', RouterView)
app.use(router)
app.mount('#app') |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
posva
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

You need to use the experimental router:
And also manually register RouterLink and RouterView in
main.ts: