Reputation: 55
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)
},
Upvotes: 0
Views: 329
Reputation: 160
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.
Upvotes: 1