Skip to content

Commit 906e47e

Browse files
author
Yousef Sultan
committed
Merge branch 'justice47-pr/loading-animation'
2 parents da94fe5 + d436a80 commit 906e47e

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
},
2727
"dependencies": {
2828
"babel-runtime": "^6.0.0",
29+
"tb-skeleton": "^0.3.5",
2930
"vue": "^1.0.21",
3031
"fuse.js": "^2.6.2"
3132
},

src/DataTable.vue

+12
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@
6666
</td>
6767
<slot name="tbody-tr" :row="row"></slot>
6868
</tr>
69+
<tr v-for="n in currentPerPage" v-if="rows.length===0&&loadingAnimation===true">
70+
<td :colspan="columns.length">
71+
<tb-skeleton :height="15" theme="opacity" bg-color="#dcdbdc" shape="radius"></tb-skeleton>
72+
</td>
73+
</tr>
6974
</tbody>
7075
</table>
7176

@@ -112,8 +117,14 @@
112117
<script>
113118
import Fuse from 'fuse.js';
114119
import locales from './locales';
120+
import 'tb-skeleton/dist/skeleton.css'
121+
import {TbSkeleton,Skeleton} from 'tb-skeleton'
115122
116123
export default {
124+
components: {
125+
TbSkeleton,
126+
Skeleton
127+
},
117128
props: {
118129
title: '',
119130
columns: {},
@@ -140,6 +151,7 @@
140151
printable: {default: true},
141152
locale: {default: 'en'},
142153
initSortCol: {default: -1}
154+
loadingAnimation: {default: true},
143155
},
144156
145157
data: () => ({

0 commit comments

Comments
 (0)