Pass all scoped slots b/w components
· ☕ 1 min read
A nice way to pass along all scoped slots to a component.
We can pass all props from the source component to target using this code -
1 2 3 4 5 6 7 <wrapper> <b-table v-bind="$attrs" v-on="$listeners"> <template v-for="(_, slot) of $scopedSlots" v-slot:[slot]="scope" ><slot :name="slot" v-bind="scope" /></template> </b-table> </wrapper> Found this in this StackOverflow post.