Components

Components are .lt files in src/components/. They're referenced declaratively by name in another component's uses: list, never imported.

Slots


<!-- Layout.lt -->
<template>
  <header>...</header>
  <main>
    <slot/>          <!-- default slot -->
  </main>
</template>

<!-- index.lt -->
<template>
  <Layout title="Hello">
    <p>Inserted into Layout's default slot.</p>
  </Layout>
</template>
    

Output convention

Each rendered component gets an id="@a"-style scope id and a data-lt-c="ComponentName" marker. Per-component CSS is emitted as <style data-c="Name"> in <head>; per-component JS as <script data-c="Name"> at end of <body>. The optimizer (a separate stage) can minify and relocate these without touching the renderer.