Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "route"

Index

Type aliases

componentModule

componentModule: object

Type declaration

  • default: object

routeProps

routeProps: boolean | object | function

Props passed to component.

  • false: default. do not resolve props.
  • true: auto-resolve props from route params.
  • object: pass this object directly to component as props.
  • function: callback function to resolve props from route object. fn(router) => props.

routeRedirect

routeRedirect: null | string | object | function

Route redirect.

  • string: plain URL.
  • object: route name {name: 'ROUTE'}.
  • function: callback function fn(to) to resolve the redirect.

Functions

cloneRoute

createRoute

  • Create route object.

    Parameters

    • location: Location

      triggered location.

    • matches: Record[]

      collection of matched route records.

    Returns Route

createRouteConfig

  • Create route config object.

    throws

    Will throw an error if the route prefab config is invalid.

    Parameters

    • prefab: RouteConfigPrefab

      route config prefab, only properties defined on svelte-router/route~RouteConfig will be used.

    Returns RouteConfig

createRouteRecord

  • Create route record.

    Parameters

    • route: RouteConfig

      Matching route config.

    • params: string[] | object

      Regex exec output or params object.

    Returns Record

Generated using TypeDoc