24

I am a rather new Vue developer. Everywhere I go in our stack, I see code like this inside our components components:

<template #item.active="{ value }">
  <div :aria-label="String(value)" class="text-center">
    <v-icon v-if="value === null">mdi-minus</v-icon>
    <v-icon v-else color="red">mdi-close</v-icon>
  </div>
</template>

And for the life of me, I am cannot figure out what the #item.active (specifically the #) actually does. We have many hashed items. Like <template #item.actions-prepend="{item}"> or <template #toolbar-extension>

Googling a # isn't an easy thing to do. And apparently I missed this specific video in my Vue tutorials! We use Nuxt and Vuetify, not sure if that helps!

dustbuster
  • 79,958
  • 7
  • 21
  • 41

1 Answers1

24

As mentioned in the comments, the # symbol is a shorthand for the v-slot attribute, as hinted by the usage of <template> (which v-slot only allows to be used on, as well as components) in your code.

tony19
  • 125,647
  • 18
  • 229
  • 307
Edric
  • 24,639
  • 13
  • 81
  • 91
  • Thank you sir! I will mark you as the answer. Of course now that i know what to google i find it everywhere! – dustbuster Sep 03 '20 at 20:29