Skip to content

struct

PageCx

pub struct PageCx {
    /* private fields */
}

What a page's companion scope gets: its parameters and query.

Methods

new

pub fn new(props: &Props) -> PageCx

The page context for a page or layout with props (its params and path).

param

pub fn param(&self, name: &str) -> Option<String>

A route parameter (slug for /blog/:slug/). Reading it inside Scope::computed follows client-side navigation between two paths of the same route.

path

pub fn path(&self) -> String

The page's address (/about/). Reading it inside Scope::computed follows client-side navigation.

params

pub fn params(&self) -> Params

Every route parameter.

props

pub fn props(&self) -> &Props

The component's props (params among them).