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.

LinkResolver

tipo Since 1.8.0

Resolvedor de enlaces que un plugin registra con app.resolveLink: recibe cada enlace de <MeekoLink> y devuelve su href final, por ejemplo con un prefijo de idioma. Se ejecuta al renderizar el enlace en el servidor, en la hidratación y en la navegación del cliente, así que debe ser puro: el mismo enlace da el mismo href en los dos lados. El estado activo (aria-current) se calcula con el href resuelto. <MeekoLink bind:resolve="false"> lo omite.

ts
import type { LinkResolver } from "@meekojs/meeko/framework";

Source code src/shared/link.ts:43

Declaración #

ts
type LinkResolver = (link: LinkResolveInput) => string

Example #

ts
import { definePlugin } from "@meekojs/meeko/framework";
import type { LinkResolver } from "@meekojs/meeko/framework";

const withBase: LinkResolver = ({ href }) => `/docs${href}`;
export default definePlugin((app) => app.resolveLink(withBase));

See also #

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/shared/link.ts