[Vuejs]-Vuejs – pass scope templates down multiple child-levels

0πŸ‘

βœ…

I had to create a github issue for this problem. As per the comments, there are multiple ways of dealing with this:

Pass the slots to the child, by using a render function, as shown below, and setting the scopedSlot property, or by using a property to pass the scopedSlots, as shown here. Or use the in version 2.2.0 added provide/inject mechanisms to set the scopedSlots (which I haven’t tried yet).

render (h) {
  return h('child', {
    scopedSlots: this.$scopedSlots
  })
}

Leave a comment