Skip to main content

<svelte:options>

还没翻译译自英文(svelte.dev)本页 4 段都还没译

<svelte:options option={value} />

The <svelte:options> element provides a place to specify per-component compiler options, which are detailed in the compiler section. The possible options are:

  • runes={true} — forces a component into runes mode (see the Legacy APIs section)
  • runes={false} — forces a component into legacy mode
  • namespace="..." — the namespace where this component will be used, can be "html" (the default), "svg" or "mathml"
  • customElement={...} — the options to use when compiling this component as a custom element. If a string is passed, it is used as the tag option
  • css="injected" — the component will inject its styles inline: During server-side rendering, it's injected as a <style> tag in the head, during client side rendering, it's loaded via JavaScript

Legacy mode

<svelte:options customElement="my-custom-element" />