0

I have the following address http://localhost:3000/script?company=1

How to display the required component at this address? What's wrog with me code?

   {
            path: '/script?company=:companyId',
            component: 'script-page',
            action: (context, commands) => this.protectedRouter(context, commands)
        },
dev_lit
  • 55
  • 6

1 Answers1

1

I think the problem is that the format /script?company=:companyId is wrong. The correct format should be like the following (assuming the companyId is required parameter)

{
    path: '/script/:companyId',
    component: 'script-page',
    action: (context, commands) => this.protectedRouter(context, commands)
},

See the Vaadin (Fusion) Router documentation for more details and examples how to use optional and wildcard URL parameters.