feature(router): remove trailing slash(es)

This commit is contained in:
2026-06-05 13:45:31 +02:00
parent cf781ff3f5
commit 1f4037f64c
+12
View File
@@ -65,6 +65,18 @@ const router = createRouter({
routes
});
// remove trailing slash(es)
router.beforeEach((route) => {
if (route.path !== '/' && route.path.endsWith('/')) {
return {
path: route.path.replace(/\/+$/, ''),
query: route.query,
hash: route.hash,
replace: true
};
};
});
// set page title
router.afterEach(to => {
const title =