Skip to content

Commit 54d84e6

Browse files
committed
docs: update readme - loading, noDataMessage prop
1 parent debe697 commit 54d84e6

File tree

1 file changed

+30
-19
lines changed

1 file changed

+30
-19
lines changed

README.md

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,37 +60,48 @@ const data = [{
6060
"status",
6161
["createdUser", "user", "name"],
6262
];
63+
const loading = ref(false);
6364

64-
{/* getData[0].createdUser.user.name || [ ["createdUser", "user", "name"] ] */}
65+
{/* getData[0].createdUser.user.name ==> [ ["createdUser", "user", "name"] ] */}
6566

6667
{/* get data from api || store */}
67-
const getData = () => {}
68+
const getData = () => {
69+
const loading = ref(true);
70+
// get data
71+
}
6872
</script>
6973

7074
<template>
71-
<VueTable :headers="headers" :keys="keyValue" :data="getData">
72-
<template #th>
73-
<th> Actions</th>
74-
</template>
75-
<template #td="{ item }">
76-
{/* item will be the object in a row */}
77-
<td class="flex">
78-
<DeleteIcon @click="deleteItem(item.id)" />
79-
<EditIcon @click="edit(item)" />
80-
</td>
81-
</template>
75+
<VueTable
76+
:headers="headers"
77+
:keys="keyValues"
78+
:data="getData"
79+
:loading="loading"
80+
>
81+
<template #th>
82+
<th> Actions</th>
83+
</template>
84+
<template #td="{ item }">
85+
{/* item will be the object in a row */}
86+
<td class="flex">
87+
<DeleteIcon @click="deleteItem(item.id)" />
88+
<EditIcon @click="edit(item)" />
89+
</td>
90+
</template>
8291
</VueTable>
8392
<template>
8493
```
8594

8695
### Props - VueTable
8796

88-
| Prop | Description | Default |
89-
| --------- | -------------------------------------- | ------- |
90-
| `data` | Data to be rendered | `[]` |
91-
| `headers` | Heading of the table | `[]` |
92-
| `keys` | Keys of the table data (can be nested) | `[]` |
93-
| `dark` | Dark mode | `false` |
97+
| Prop | Description | Default |
98+
| --------------- | -------------------------------------- | ------------------- |
99+
| `data` | Data to be rendered | |
100+
| `headers` | Heading of the table | |
101+
| `keys` | Keys of the table data (can be nested) | |
102+
| `dark` | Dark mode | `false` |
103+
| `loading` | Data loading state - show a spinner | `false` |
104+
| `noDataMessage` | Message when there is no data | `No data available` |
94105

95106
## VuePaginator
96107

0 commit comments

Comments
 (0)