framework7 icon indicating copy to clipboard operation
framework7 copied to clipboard

Requesting v2 Router documentation about trailing slashes in path

Open danielbprice opened this issue 7 years ago • 3 comments

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.

danielbprice avatar Apr 02 '18 22:04 danielbprice

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

nolimits4web avatar Apr 03 '18 07:04 nolimits4web

I think i will better add an option to make them as same routes

nolimits4web avatar Apr 03 '18 07:04 nolimits4web

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.

stale[bot] avatar Jun 21 '18 18:06 stale[bot]