-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.vue
42 lines (39 loc) · 1.03 KB
/
index.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<template>
<div class="overlay-wrapper position-relative table-responsive" :class="{'overflow-hidden':loading}">
<div v-if="loading" class="overlay ">
<i class="fas fa-3x fa-sync-alt fa-spin"></i><div class="text-bold pt-2">Loading...</div>
</div>
<table class="table">
<thead>
<tr>
<th v-for="(header,index) in headers" :key="index">{{header.label ?? header}}</th>
</tr>
</thead>
<tbody>
<!-- <td v-for="(header,index) in headers" :key="index"> -->
<slot ></slot>
<!-- <slot :name="cell(header)" :header="header" :index="index"> </slot> -->
<!-- </td> -->
</tbody>
</table>
</div>
</template>
<script>
export default {
props:{
headers:{type:[Array,Object],required:true},
loading:{type:Boolean,default:false},
},
setup(props){
function cell(str){
console.log(str)
return str;
}
return {
cell
}
}
}
</script>
<style>
</style>