Updated Data Table Component
This commit is contained in:
parent
4955756ce7
commit
62d403ffc2
1 changed files with 6 additions and 6 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue