Skip to content

Commit d35c972

Browse files
committed
fix item slot
1 parent 5e9a05f commit d35c972

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"author": "HC200ok",
44
"description": "A customizable and easy-to-use data table component made with Vue.js 3.x.",
55
"private": false,
6-
"version": "1.5.39",
6+
"version": "1.5.40",
77
"types": "./types/main.d.ts",
88
"license": "MIT",
99
"files": [

src/components/DataTable.vue

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,9 @@
145145
// eslint-disable-next-line max-len
146146
}, typeof bodyItemClassName === 'string' ? bodyItemClassName : bodyItemClassName(column, index + 1), `direction-${bodyTextDirection}`]"
147147
@click="column === 'expand' ? updateExpandingItemIndexList(index + prevPageEndIndex, item, $event) : null"
148-
>
149-
<slot
150-
v-if="slots['item']"
151-
name="item"
152-
v-bind="{column, item}"
153-
/>
148+
>
154149
<slot
155-
v-else-if="slots[`item-${column}`]"
150+
v-if="slots[`item-${column}`]"
156151
:name="`item-${column}`"
157152
v-bind="item"
158153
/>
@@ -161,7 +156,6 @@
161156
:name="`item-${column.toLowerCase()}`"
162157
v-bind="item"
163158
/>
164-
165159
<template v-else-if="column === 'expand'">
166160
<i
167161
class="expand-icon"
@@ -174,6 +168,11 @@
174168
@change="toggleSelectItem(item)"
175169
/>
176170
</template>
171+
<slot
172+
v-else-if="slots['item']"
173+
name="item"
174+
v-bind="{column, item}"
175+
/>
177176
<template v-else>
178177
{{ generateColumnContent(column, item) }}
179178
</template>

src/modes/Client.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@
8989
</div>
9090
</template>
9191

92-
<template #item="{column, item}">
92+
<!-- <template #item="{column, item}">
9393
<div style="padding: 15px">
9494
column: {{ column }} item: {{ item }}
9595
</div>
96-
</template>
96+
</template> -->
9797

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

0 commit comments

Comments
 (0)