Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

PageModule

interfaz

Forma de un módulo .meeko compilado que el handler del servidor renderiza como página, layout o página de error.

ts
import type { PageModule } from "@meekojs/meeko/server";

Source code src/server/runtime/framework-render.ts:88

Declaración #

ts
interface PageModule {
	css?: string
	renderWithState(props: Record<string, unknown>): { html: string; state: Record<string, unknown> }
	renderToString?(props: Record<string, unknown>): string
}

Example #

ts
import type { PageModule } from "@meekojs/meeko/server";

const pages = import.meta.glob<PageModule>("/app/pages/*.meeko");
const loadPage = async (file: string): Promise<PageModule> => pages[file]!();

Miembros #

css #

propiedad opcional

css?: string

CSS con ámbito del componente.

renderWithState #

método

renderWithState(props: Record<string, unknown>): { html: string; state: Record<string, unknown> }

Renderiza el HTML y captura el estado que se transfiere al navegador.

renderToString #

método opcional

renderToString?(props: Record<string, unknown>): string

Renderiza sólo el HTML.

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/server/runtime/framework-render.ts