Skip to content

Commit

Permalink
Add slot for list items
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Sep 19, 2024
1 parent 851af88 commit aaf5651
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@sfgrp/distinguish",
"private": false,
"type": "module",
"version": "0.2.0",
"version": "0.3.0",
"files": [
"dist"
],
Expand Down
18 changes: 16 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@

<VGrid :class="gridLayout">
<PanelDescriptors />
<PanelRemaining :render="props.renderItem" />
<PanelEliminated :render="props.renderItem" />
<PanelRemaining :render="props.renderItem">
<template #default="slotProps">
<slot
name="remaining-item"
v-bind="slotProps"
/>
</template>
</PanelRemaining>
<PanelEliminated :render="props.renderItem">
<template #default="slotProps">
<slot
name="eliminated-item"
v-bind="slotProps"
/>
</template>
</PanelEliminated>
</VGrid>

<VSpinner
Expand Down
7 changes: 5 additions & 2 deletions src/components/Panel/PanelEliminated.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
v-for="item in eliminated"
:key="item.rowId"
class="distinguish-row-item"
v-html="render ? render(item) : item.objectTag"
/>
>
<slot :item="item">
<span v-html="render ? render(item) : item.objectTag" />
</slot>
</li>
</ul>
</VPanel>
</template>
Expand Down
7 changes: 5 additions & 2 deletions src/components/Panel/PanelRemaining.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
v-for="item in remaining"
:key="item.rowId"
class="distinguish-row-item"
v-html="render ? render(item) : item.objectTag"
/>
>
<slot :item="item">
<span v-html="render ? render(item) : item.objectTag" />
</slot>
</li>
</ul>
</VPanel>
</template>
Expand Down

0 comments on commit aaf5651

Please sign in to comment.