“transcash” Código de respuesta

transcash

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

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

transcash

<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

transcash

<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

transcash

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

transcash

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

transcash

<!-- 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

transcash

<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

transcash

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

transcash

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

transcash

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

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código