Skip to content

Commit

Permalink
fix item slot
Browse files Browse the repository at this point in the history
  • Loading branch information
HC200ok committed Mar 19, 2023
1 parent 5e9a05f commit d35c972
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "HC200ok",
"description": "A customizable and easy-to-use data table component made with Vue.js 3.x.",
"private": false,
"version": "1.5.39",
"version": "1.5.40",
"types": "./types/main.d.ts",
"license": "MIT",
"files": [
Expand Down
15 changes: 7 additions & 8 deletions src/components/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,9 @@
// eslint-disable-next-line max-len
}, typeof bodyItemClassName === 'string' ? bodyItemClassName : bodyItemClassName(column, index + 1), `direction-${bodyTextDirection}`]"
@click="column === 'expand' ? updateExpandingItemIndexList(index + prevPageEndIndex, item, $event) : null"
>
<slot
v-if="slots['item']"
name="item"
v-bind="{column, item}"
/>
>
<slot
v-else-if="slots[`item-${column}`]"
v-if="slots[`item-${column}`]"
:name="`item-${column}`"
v-bind="item"
/>
Expand All @@ -161,7 +156,6 @@
:name="`item-${column.toLowerCase()}`"
v-bind="item"
/>

<template v-else-if="column === 'expand'">
<i
class="expand-icon"
Expand All @@ -174,6 +168,11 @@
@change="toggleSelectItem(item)"
/>
</template>
<slot
v-else-if="slots['item']"
name="item"
v-bind="{column, item}"
/>
<template v-else>
{{ generateColumnContent(column, item) }}
</template>
Expand Down
4 changes: 2 additions & 2 deletions src/modes/Client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@
</div>
</template>

<template #item="{column, item}">
<!-- <template #item="{column, item}">
<div style="padding: 15px">
column: {{ column }} item: {{ item }}
</div>
</template>
</template> -->

<!-- <template #item-lastAttended="item">
<div style="padding: 15px">
Expand Down

0 comments on commit d35c972

Please sign in to comment.