How to get all route params/data

前端 未结 6 563
执念已碎
执念已碎 2020-12-24 07:20

Given a route config

{
   path: \'/root/:rootId\',
   children: [{
       path: \'/child1/:child1Id\',
       children: [{
           path: \'/child2/:child2         


        
6条回答
  •  暖寄归人
    2020-12-24 08:17

    I got the first route param this way:

    console.log(this.route.snapshot.firstChild.params)

提交回复
热议问题