Screen
Observe and control navigation within the app.
Listen to navigation
// Listen to navigation
ctx.screen.onNavigate(e => {
// User navigated to the 'One Piece' anime page
console.log(e.pathname) // /entry
console.log(e.searchParams) // { "id": "21" }
})
// Or as a state
const screen = ctx.screen.getState()
const isAnimeEntry = ctx.computed(() => screen.get().current === "entry", [screen])
isAnimeEntry.get()Navigate
// Navigate to the 'Sakamoto Days' anime page
ctx.screen.navigateTo("/entry", { "id": "177709" })Reload the screen
Get the current screen
Last updated