This commit is contained in:
Timo Hocker
2019-09-03 12:24:50 +02:00
parent 41a6bf7048
commit 0405443391
5 changed files with 10 additions and 95 deletions

View File

@ -1,8 +1,11 @@
<template>
<div id="app">
<div>
{{json}}
<table>
<LogEntry v-for="(value,key) in json" :key="key" :columns="value"></LogEntry>
<tr v-for="(row,rowKey) in json" :key="rowKey">
<td v-for="(value,key) in row" :key="key">{{value}}</td>
</tr>
</table>
</div>
<br />
@ -12,31 +15,12 @@
rel="license"
href="https://www.gnu.org/licenses/gpl-3.0.en.html"
>GNU General Public License v3.0 or later &copy; Timo Hocker</a>
<!--
<script>
fetch('?json')
.then(res => res.json())
.then(json => {
let data = '<table>';
for (let row of json) {
data += `<tr><td>${row.join('</td><td>')}</td></tr>`;
}
data += '</table>';
document.getElementById('data').innerHTML = data;
});
</script>
</body>
</html>
-->
</div>
</template>
<script>
import LogEntry from "./components/LogEntry.vue";
export default {
name: "App",
components: ["LogEntry"],
data: {
json: []
},
@ -45,6 +29,7 @@ export default {
.then(res => res.json())
.then(json => {
this.json = json;
console.log(this.json);
});
}
};

View File

@ -1,15 +0,0 @@
<template>
<tr>
<td v-for="(value,key) in columns" :key="key">{{value}}</td>
</tr>
</template>
<script>
export default {
name: "LogEntry",
props: ["columns"]
};
</script>
<style>
</style>