Skip to content

Set caseSensitive and pathToRegexpOptions defaults on router #2404

Open
@rightaway

Description

@rightaway

What problem does this feature solve?

caseSensitive and pathToRegexpOptions are set on each of the routes individually, which is redundant and not clean especially when working a very large number of routes and across multiple files. It would simplify the code to be able to set it as a default on the router itself, and each of the routes will inherit that if they don't override it in their own route config.

What does the proposed API look like?

new VueRouter({
  caseSensitive: true,
  pathToRegexpOptions: {},
  routes: [
    { path: '/example', caseSensitive: false, pathToRegexpOptions: {} }
  ]
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestfixed on 4.xThis issue has been already fixed on the v4 but exists in v3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions