Slots in Vue 3 Deep Dive
Slots in Vue 3 Deep Dive
The basic concept of slots remains the same: they allow parent components to pass content to child components However, Vue 3 introduces named
To inject HTML content into a particular slot, use the slot attribute on any child element to specify the name of the slot All other child elements of the
vue vslot The scoped slot now has two properties, row which represents the current row, and prop which represents the name of the current column The
vue check if slot has content This means that we can use the presence of our slot's name in this object as a boolean value to conditionally do things in our UI
Regular
price
151.00 ₹ INR
Regular
price
151.00 ₹ INR
Sale
price
151.00 ₹ INR
Unit price
/
per