Fix route params.
This commit is contained in:
parent
73a8758250
commit
3aa7b181c9
@ -183,9 +183,13 @@ export class TpRouter extends LitElement {
|
|||||||
this.routes[namespace] = {};
|
this.routes[namespace] = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const keys = [];
|
||||||
|
const r = pathToRegexp(path, keys);
|
||||||
|
r.keys = keys;
|
||||||
|
|
||||||
this.routes[namespace][path] = {
|
this.routes[namespace][path] = {
|
||||||
path: path,
|
path: path,
|
||||||
regex: pathToRegexp(path),
|
regex: r,
|
||||||
data: data,
|
data: data,
|
||||||
redirect: redirect,
|
redirect: redirect,
|
||||||
params: {}
|
params: {}
|
||||||
|
Loading…
Reference in New Issue
Block a user