“транскаш” Ответ

транскаш

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

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

транскаш

<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

транскаш

<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

транскаш

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

транскаш

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

транскаш

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

транскаш

<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

транскаш

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

транскаш

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

транскаш

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

Смотреть популярные ответы по языку

Смотреть другие языки программирования