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.

HeadScript

interfaz Since 1.2.0

Etiqueta <script> de HeadInput: externa con src o en línea con children. Se deduplica por key, por src o por su código.

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

Source code src/shared/head.ts:84

Declaración #

ts
interface HeadScript {
	src?: string
	type?: string
	async?: boolean
	defer?: boolean
	module?: boolean
	children?: string
	key?: string
}

Example #

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

const analytics: HeadScript = { src: "https://example.com/analytics.js", defer: true };
const theme: HeadScript = { children: "document.documentElement.dataset.theme = localStorage.theme ?? 'light'" };

Propiedades #

src #

propiedad opcional

src?: string

URL del script externo.

type #

propiedad opcional

type?: string

Atributo type, como "application/ld+json".

async #

propiedad opcional

async?: boolean

Atributo async.

defer #

propiedad opcional

defer?: boolean

Atributo defer.

module #

propiedad opcional

module?: boolean

Escribe type="module" si no hay type.

children #

propiedad opcional

children?: string

Inline code; Meeko adds the CSP nonce.

key #

propiedad opcional

key?: string

Clave de deduplicación explícita; no se escribe en 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/shared/head.ts