I see that {!Route.param} expression can be used to retrieve query parameters within a custom component placed in LWR.
But I don't know how to describe this in custom component, so please let me know.
I see that {!Route.param} expression can be used to retrieve query parameters within a custom component placed in LWR.
But I don't know how to describe this in custom component, so please let me know.
this is one of the most exciting features of LWR sites. You can use it to pass a URL parameter as an input into any standard or custom component that you are using on your LWR Site. For example if you want to use an'id' url parameter as an input into your custom LWC. You need to expose that parameter using @api in your js file
example @api orderId;
in the meta file you can expose it like below
<targetConfigs>
<targetConfig targets="lightningCommunity__Default">
<property name="orderId" type="String" default="{!Route.id}"></property>
</targetConfig>
</targetConfigs>
Next you can drag and drop this component in your LWR site. Once this has been done, if anyone navigates to your LWR site using id as an URL parameter (example https://test.my.site.com/lwr/orders?id=00abcdefghik) then the LWC component on that page will automatically get initialised with the provided order id.
Hope this helps