fix(nuxt): pass undefined name when resolving trailing slash (#26358)

This commit is contained in:
Daniel Roe 2024-03-18 21:12:17 +00:00 committed by GitHub
parent 8d6eab4822
commit c49d206647
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -113,14 +113,10 @@ export function defineNuxtLink (options: NuxtLinkOptions) {
const resolvedPath = { const resolvedPath = {
...to, ...to,
name: undefined, // named routes would otherwise always override trailing slash behavior
path: applyTrailingSlashBehavior(path, options.trailingSlash) path: applyTrailingSlashBehavior(path, options.trailingSlash)
} }
// named routes would otherwise always override trailing slash behavior
if ('name' in resolvedPath) {
delete resolvedPath.name
}
return resolvedPath return resolvedPath
} }