pumper
pumper

Reputation: 141

how does v-slot works?

I don't understand the mechanism of v-slot. and how it works.how it binds to the variables.

in the code below that comes from vuetify documentation please explain this part:

<template v-slot:thumb-label="props">
   <span>
   {{ season(props.value) }}
   </span>
</template>

I dont understand what is "props" and how it connects to seasons variabe.

https://codepen.io/pumper/pen/NZZpeO

Upvotes: 2

Views: 579

Answers (1)

depperm
depperm

Reputation: 10756

The v-slot is overriding the default thumb-label slot and passing the v-range-slider value prop (props, or what is selected). It isn't connected to the seasons variable, instead it calls the season() method and passes the value of the current range.

Upvotes: 1

Related Questions