diff --git a/dist/router.js b/dist/router.js index bf037ad..2eec438 100644 --- a/dist/router.js +++ b/dist/router.js @@ -70,7 +70,7 @@ export default class Router { } use(obj) { if (obj instanceof Router) { - this.routes = Object.assign(Object.assign({}, this.routes), obj.routes); + this.routes = [...this.routes, ...obj.routes]; this.sortRoutes(); } if (obj instanceof Tpl) { diff --git a/src/router.ts b/src/router.ts index 407238a..4eccbeb 100644 --- a/src/router.ts +++ b/src/router.ts @@ -95,7 +95,7 @@ export default class Router { */ use(obj: Router | Tpl): void { if(obj instanceof Router) { - this.routes = { ...this.routes, ...obj.routes }; + this.routes = [ ...this.routes, ...obj.routes ]; this.sortRoutes(); } if(obj instanceof Tpl) {