Vuejs.org: Ambiguous statements about default slots

Created on 13 Feb 2019  ·  7Comments  ·  Source: vuejs/vuejs.org

In new slot documentation in one place it states:

Whenever there are multiple slots, use the full <template> based syntax for all slots

And in another section (Named Slots Shorthand) there is an example:

<base-layout>
  <template #header>
    <h1>Here might be a page title</h1>
  </template>

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

  <template #footer>
    <p>Here's some contact info</p>
  </template>
</base-layout>

So what is the best practice for defining default slot when there are multiple of them?

PR in progress

Most helpful comment

I'm going to try to rewrite this section with a few more details coming up with the Vue 3 release, I'll try to fix this in that update.

All 7 comments

If I get what you mean correctly, it seems you're confused between the _abbreviated syntax for lone default slots_ (<user><template v-slot:default="slotProps"/></user> => <user v-slot="slotProps"/>) and the _shorthand syntax_ (<template v-slot:header> => <template #header>). The example above uses shorthand syntax while still correctly adheres to the "full <template> based" syntax for multiple slots.

Whenever there are multiple slots, use the full