framework7
framework7 copied to clipboard
Requesting v2 Router documentation about trailing slashes in path
This is a (multiple allowed):
-
[ ] bug
-
[X] enhancement
-
[ ] feature-discussion (RFC)
-
Framework7 Version: 2.1.3
-
Platform and Target: generic
What you did
All of the Framework7 router documentation uses trailing slashes in the example routes. It's good that it is consistent. For example, it says:
var view1 = app.views.create('.view-1', {
routes: [
{
path: '/users/',
url: './pages/users.html',
},
{
path: '/user/',
url: './pages/user.html',
},
],
});
However, the role of those trailing slashes is never really explained. I tried removing them in my F7-Vue application, and it worked perfectly in most but not all cases-- it took me quite a while to realize that not having the trailing slashes seemed to be the issue. If it's a misconfiguration, it would be nice if the framework could just emit a warning. If it's a feature, maybe an explanation would help others.
Expected Behavior
Documentation improvement to explain the semantics of the trailing slashes.
not having the trailing slashes seemed to be the issue
It is not true. If you don't have trailing slashes in route path then you just need to have the same in links or when you call router.navigate. Currently routes with paths with and without trailing slashed are treated as different paths
I think i will better add an option to make them as same routes
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.