Fix route params.

This commit is contained in:
Peter Kaske 2022-06-14 15:04:08 +02:00
parent 73a8758250
commit 3aa7b181c9

View File

@ -183,9 +183,13 @@ export class TpRouter extends LitElement {
this.routes[namespace] = {};
}
const keys = [];
const r = pathToRegexp(path, keys);
r.keys = keys;
this.routes[namespace][path] = {
path: path,
regex: pathToRegexp(path),
regex: r,
data: data,
redirect: redirect,
params: {}