Skip to content

$laika / useLaika()

Provides access to the active LAIKA runtime.

Use $laika inside Vue templates or useLaika() inside <script setup> and other Composition API contexts.

NOTE

This is a low-level API. Prefer the focused payload, router and OctoberCMS composables for normal page development.

Basic Usage

vue
<template>
    <p>Current component: {{ $laika.payload?.page.component }}</p>
</template>

<script lang="ts" setup>
import { useLaika } from '@ratmd/laika';

const laika = useLaika();
console.log(laika.payload?.page.url);
</script>

Runtime Properties

PropertyDescription
componentCurrently resolved Vue page component.
payloadCurrent LAIKA payload.
layoutPending or active runtime layout value.
keyCurrent page-component render key.
titleCallback used to transform the document title.
resolverCallback used to resolve Vue page components.

Runtime Methods

MethodDescription
getLayout()Returns the current runtime layout value.
setLayout(layout)Sets a layout override consumed by the LAIKA renderer.

This software is not an official OctoberCMS product and is not associated with, sponsored by, or endorsed by OctoberCMS.