Skip to content

Fix router-class.js for correct navigate if used route path format like /:optionalParam(any+[regexp]+)?#4179

Merged
nolimits4web merged 1 commit intoframework7io:masterfrom
100100101:customize
May 23, 2023
Merged

Fix router-class.js for correct navigate if used route path format like /:optionalParam(any+[regexp]+)?#4179
nolimits4web merged 1 commit intoframework7io:masterfrom
100100101:customize

Conversation

@100100101
Copy link
Contributor

For example:
We have 2 routes

const view: View.Parameters = {
    routes: [
        {
            name: 'home',
            path: '/:anyOptionalParam(any+[regex]+)?',
        },
        {
            name: 'about',
            path: '/about',
        },
    ],
}
  1. If started at 'about' page (http://localhost/about)
  2. Call
currentViewRouter.navigate({
    name: 'home'
})
  1. Have error Uncaught (in promise) Error: Framework7: can't construct URL for route with name "home"

@nolimits4web nolimits4web merged commit 6d40482 into framework7io:master May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants