c3lf-system-3/src/components/Table.vue

36 lines
1,017 B
Vue
Raw Normal View History

2019-11-14 03:37:35 +00:00
<template>
<table class="table table-striped table-dark">
<thead>
2019-11-14 18:30:00 +00:00
<tr>
<th scope="col" v-for="(column, index) in columns" :key="index">
2019-11-15 19:00:40 +00:00
<button class="btn text-light" @click="toggleSort(column)">
2019-11-14 18:30:00 +00:00
{{ column }}
<span :class="{ 'text-info': column === sortBy }">
2019-11-15 19:00:40 +00:00
<font-awesome-icon :icon="getSortIcon(column)"/>
2019-11-14 18:30:00 +00:00
</span>
</button>
</th>
</tr>
2019-11-14 03:37:35 +00:00
</thead>
2019-11-14 18:30:00 +00:00
<tbody>
<tr v-for="item in internalItems" :key="item[keyName]">
<td v-for="(column, index) in columns" :key="index">{{ item[column] }}</td>
</tr>
</tbody>
2019-11-14 03:37:35 +00:00
</table>
</template>
<script>
2019-11-15 19:00:40 +00:00
import DataContainer from '@/mixins/data-container';
2019-11-14 18:30:00 +00:00
2019-11-14 03:37:35 +00:00
export default {
name: 'Table',
2019-11-15 19:00:40 +00:00
mixins: [DataContainer]
2019-11-14 03:37:35 +00:00
};
2019-11-14 18:30:00 +00:00
</script>
<style>
.table-body-move {
transition: transform 1s;
}
</style>