Vue - how to pass down slots inside wrapper component?

前端 未结 2 2009
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 08:36

So I\'ve created a simple wrapper component with template like:


   
<         


        
2条回答
  •  执笔经年
    2020-12-04 09:18

    I have been automating the passing of any (and all) slots using v-for, as shown below. The nice thing with this method is that you don't need to know which slots have to be passed on, including the default slot. Any slots passed to the wrapper will be passed on.

    
      
    
        
        
    
        
        
    
      
    
    

提交回复
热议问题