Skip to content

PageRouter: Add convenience APIs for otherwise manual tasks

Jan Blackquill requested to merge work/cblack/pagerouter-convenience-apis into master

Routes now support arbitrary properties, allowing properties on the root item of the route to be set.

Replaces

if (Kirigami.PageRouter.data.property)
    root.property = Kirigami.PageRouter.data.property
if (Kirigami.PageRouter.data.property1)
    root.property = Kirigami.PageRouter.data.property1
if (Kirigami.PageRouter.data.property2)
    root.property = Kirigami.PageRouter.data.property2
if (Kirigami.PageRouter.data.property3)
    root.property = Kirigami.PageRouter.data.property3
if (Kirigami.PageRouter.data.property4)
    root.property = Kirigami.PageRouter.data.property4

with

{"route": "home", "property": "data"}

replaceFromHere allows the current route to be replaced

Replaces

Kirigami.PageRouter.popFromHere()
Kirigami.PageRouter.pop()
Kirigami.PageRouter.pushFromHere("route")

with

Kirigami.PageRouter.replaceFromHere("route")

Merge request reports

Loading