yunzhiclub / ng

angular开源库
2 stars 0 forks source link

修正routingTesting 使queryParams 与 navigate 配合工作 #19

Closed teacherpan closed 3 years ago

teacherpan commented 3 years ago

发送

  reload(): void {
    this.router.navigate(['./'],
      {
        relativeTo: this.route,
        queryParams: this.queryParams
      }).then();
  }

接收

    this.route.queryParams.subscribe((params: { page?: string, size?: string }) => {
      // 复制查询参数
      this.queryParams = {...params};