Updated Data Table Component

This commit is contained in:
Sebin Nyshkim 2019-11-03 20:45:24 +01:00
parent 4955756ce7
commit 62d403ffc2

View file

@ -2,15 +2,15 @@
<table>
<thead>
<tr>
<template v-for="header in headers">
<template v-for="header in dataset.headers">
<th :key="header">{{ header }}</th>
</template>
</tr>
</thead>
<tbody>
<template v-for="dataset in data">
<tr :key="dataset[0]">
<template v-for="item in dataset">
<template v-for="tuple in dataset.data">
<tr :key="tuple[0]">
<template v-for="item in tuple">
<td :key="item">{{ item }}</td>
<template v-if="isHexValue(item)">
<td :key="item" :style="'background-color:'+item"></td>
@ -24,9 +24,9 @@
<script>
export default {
name: "DataTable",
props: {
headers: Array,
data: Array
dataset: Object
},
methods: {
isHexValue(value) {