ratiw / vuetable-2-tutorial

MIT License
258 stars 67 forks source link

Passing Scoped Slot to MyVuetable in Template #56

Open PejmanNik opened 7 years ago

PejmanNik commented 7 years ago

Hi I think this way we can fix the problem you explained in lesson 17 Passing Scoped Slot to MyVuetable in Template by v-for on slotName in Object.keys($scopedSlots) Thanks for your great Tutorial

ratiw commented 7 years ago

@PejmanNik That is a really interesting way of passing the scoped slot. Thanks for sharing! :)

PejmanNik commented 7 years ago

@ratiw Thank you :)

ghost commented 6 years ago

With Vue 2.5 it's now the way to follow ... thanks In this case we don't need anymore the CustomAction.vue component

using render function was interesting for better understanding , but should it be now deprecated ?

ghost commented 6 years ago

to avoid warning binding :key should be added to a wrapper element

     <template :slot="slotName" slot-scope="props" v-for="(slotName, index) in  $scopedSlots?Object.keys($scopedSlots):null">
       <div :key="index">
          <slot :name="slotName" :row-data="props.rowData" :row-index="props.rowIndex" :row-field="props.rowField"></slot>
     </div> 
     </template>