“Transcak” Respostas de código

Transcak

<base-layout>
  <h1 slot="header">Here might be a page title</h1>

  <p>A paragraph for the main content.</p>
  <p>And another one.</p>

  <p slot="footer">Here's some contact info</p>
</base-layout>
Strange Sandpiper

Transcak

<current-user>
  {{ user.firstName }}
</current-user>
Strange Sandpiper

Transcak

<span>
  <slot v-bind:user="user">
    {{ user.lastName }}
  </slot>
</span>
Strange Sandpiper

Transcak

<current-user v-slot:default="slotProps">
  {{ slotProps.user.firstName }}
</current-user>
Strange Sandpiper

Transcak

<current-user>
  <template v-slot:default="slotProps">
    {{ slotProps.user.firstName }}
  </template>

  <template v-slot:other="otherSlotProps">
    ...
  </template>
</current-user>
Strange Sandpiper

Transcak

<base-layout>
  <template slot="header">
    <h1>Here might be a page title</h1>
  </template>

  <p>A paragraph for the main content.</p>
  <p>And another one.</p>

  <template slot="footer">
    <p>Here's some contact info</p>
  </template>
</base-layout>
Strange Sandpiper

Transcak

<div class="container">
  <header>
    <h1>Here might be a page title</h1>
  </header>
  <main>
    <p>A paragraph for the main content.</p>
    <p>And another one.</p>
  </main>
  <footer>
    <p>Here's some contact info</p>
  </footer>
</div>
Strange Sandpiper

Transcak

<span>
  <slot>{{ user.lastName }}</slot>
</span>
Strange Sandpiper

Transcak

<current-user>
  <template v-slot:default="slotProps">
    {{ slotProps.user.firstName }}
  </template>
</current-user>
Strange Sandpiper

Transcak

<!-- INVALID, will result in warning -->
<current-user v-slot="slotProps">
  {{ slotProps.user.firstName }}
  <template v-slot:other="otherSlotProps">
    slotProps is NOT available here
  </template>
</current-user>
Strange Sandpiper

Procure respostas de código populares por idioma

Procurar outros idiomas de código