1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-07 02:28:54 +08:00

Initial commit

This commit is contained in:
lana-k
2020-09-20 22:52:06 +02:00
commit 0a0407cb04
27 changed files with 17617 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<template>
<vue-good-table v-if="data" :columns="columns" :rows="rows"/>
</template>
<script>
import 'vue-good-table/dist/vue-good-table.css'
import { VueGoodTable } from 'vue-good-table'
export default {
name: 'SqlTable',
components: { VueGoodTable },
props: ['data'],
computed: {
columns () {
const columns = []
this.data.columns.forEach(column => {
columns.push({ label: column, field: column })
})
return columns
},
rows () {
const rows = []
this.data.values.forEach(row => {
const newRow = {}
row.forEach((value, index) => {
const column = this.data.columns[index]
newRow[column] = value
})
rows.push(newRow)
})
return rows
}
}
}
</script>