Skip to content

Commit

Permalink
improvement(vuehorizontaltimeline): adds Scoped Slot compatibility
Browse files Browse the repository at this point in the history
As of vue 2.6.0, the recommended way to scope slots is by passing data up from the child component.
By binding each item of the iteration, we can access specific data about that item in our slot
template.
  • Loading branch information
jollyjerr committed Feb 4, 2020
1 parent d30486b commit d240b4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/VueHorizontalTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ol>
<li v-for="(item, i) in items" :key="i" :style="setLineColor">
<div class="time" :class="getTimeClass(item)" :style="getTimeStyles" @click="cardClicked(item)">
<slot v-if="hasSlot"/>
<slot v-if="hasSlot" v-bind:item="item"/>
<span
class="title"
v-if="!hasSlot && item[titleAttr]"
Expand Down

0 comments on commit d240b4d

Please sign in to comment.