File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -649,7 +649,7 @@ class Router extends Framework7Class {
649649 if ( matchingRoute ) return ;
650650 const keys = [ ] ;
651651
652- const pathsToMatch = [ route . path ] ;
652+ const pathsToMatch = [ route . path || '/' ] ;
653653 if ( route . alias ) {
654654 if ( typeof route . alias === 'string' ) pathsToMatch . push ( route . alias ) ;
655655 else if ( Array . isArray ( route . alias ) ) {
@@ -662,7 +662,7 @@ class Router extends Framework7Class {
662662 let matched ;
663663 pathsToMatch . forEach ( ( pathToMatch ) => {
664664 if ( matched ) return ;
665- matched = pathToRegexp ( pathToMatch , keys ) . exec ( path ) ;
665+ matched = pathToRegexp ( pathToMatch , keys ) . exec ( path || '/' ) ;
666666 } ) ;
667667
668668 if ( matched ) {
@@ -678,7 +678,7 @@ class Router extends Framework7Class {
678678
679679 let parentPath ;
680680 if ( route . parentPath ) {
681- parentPath = path
681+ parentPath = ( path || '/' )
682682 . split ( '/' )
683683 . slice ( 0 , route . parentPath . split ( '/' ) . length - 1 )
684684 . join ( '/' ) ;
@@ -689,7 +689,7 @@ class Router extends Framework7Class {
689689 hash,
690690 params,
691691 url,
692- path,
692+ path : path || '/' ,
693693 parentPath,
694694 route,
695695 name : route . name ,
You can’t perform that action at this time.
0 commit comments