“Transcash” Kod odpowiedzi

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

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

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu