Closed camillegrings closed 5 years ago
Hi!
Currently, you can't define patterns using a regex-like syntax, like (x|y)
. The only feature of the pattern string is to have parameters (e.g. /users/:name
). I will probably add support for this kind of patterns in the next version though, se #16 for more details.
Hi. I don't know if i'm doing something wrong, but i have the following issue: I have the route
router.add({ name: 'index', pattern: '/(|index)', page: '/home' })
and this works for both url/
and/index
, which is what i want. But, when i have a Link that goes to the routeindex
, the url changes to/(%7Cindex)
, and i wanted to go to/
. My question is: there is a way to choose what pattern i would like to show on the url when i click on a Link?I found a way to make it work by using two differents routes:
router.add({ name: 'home', pattern: '/', page: '/home' })
androuter.add({ name: 'index', pattern: '/index', page: '/home' })
, but i wanted to know if there was a way to make the same without duplicating the route.