Last active
May 27, 2019 11:48
-
-
Save onmotion/0a2efce1fe07d7914d28b15b23c5d496 to your computer and use it in GitHub Desktop.
Vue js pass slot to child component wrapper through template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- pass scoped slots --> | |
<!-- bind props as a Object for reactively binding props which contains getter and setter --> | |
<template v-for="(_, name) in $scopedSlots" v-slot:[name]="slotData"> | |
<slot :name="name" v-bind="{props: slotData}" /> | |
</template> | |
<!-- pass slots --> | |
<template v-for="(_, name) in $slots" :slot="name"> | |
<slot :name="name"/> | |
</template> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment