0 votes
in VueJS by
What is the purpose new slot directive?

1 Answer

0 votes
by

In Vue 2.6 version, the new slot syntax is provided using v-slot directive which aligns syntax with Vue 3.0. This is going to be replacement for old slot syntax.

The comparison for old and new slot syntax:

<!-- old -->
<user>
  <template slot="header" slot-scope="{ msg }">
    text slot: {{ msg }}
  </template>
</user>

<!-- new -->
<user>
  <template v-slot:header="{ msg }">
    text slot: {{ msg }}
  </template>
</user>

Related questions

0 votes
asked Sep 10, 2023 in VueJS by DavidAnderson
0 votes
asked Sep 9, 2023 in VueJS by AdilsonLima
...