Skip to content

Commit

Permalink
Merge pull request #46 from HC200ok/Fix/single-sorting-duplicate-tows
Browse files Browse the repository at this point in the history
Fix: single field sorting duplicate rows
  • Loading branch information
HC200ok authored Jun 27, 2022
2 parents 2a66669 + 1d478b3 commit 9d231b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 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.2.18",
"version": "1.2.19",
"types": "./types/main.d.ts",
"license": "MIT",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions src/components/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
:class="{'row-alternation': alternating, 'hover-to-change-color': hoverToChangeColor}"
>
<tr
v-for="(item) in itemsForRender"
:key="JSON.stringify(item)"
v-for="(item, index) in itemsForRender"
:key="index"
@click="clickRow(item)"
>
<td
Expand Down
6 changes: 3 additions & 3 deletions src/modes/Client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ import DataTable from '../components/DataTable.vue';
import { mockClientNestedItems, mockClientItems, mockDuplicateClientNestedItems } from '../mock';
const searchField = ref('name');
const searchValue = ref('name-1');
const searchValue = ref('');
const items = ref<Item[]>(mockDuplicateClientNestedItems(100));
const items = ref<Item[]>(mockDuplicateClientNestedItems(5));
const switchToNested300 = () => {
items.value = mockClientNestedItems(300);
Expand All @@ -135,7 +135,7 @@ const switchToNested = () => {
};
const headers: Header[] = [
{ text: 'Name', value: 'name' },
{ text: 'Name', value: 'name', sortable: true },
{ text: 'Address', value: 'address', width: 200 },
{ text: 'Height', value: 'info.out.height', sortable: true },
{ text: 'Weight', value: 'info.out.weight', sortable: true },
Expand Down

0 comments on commit 9d231b3

Please sign in to comment.