fixes
This commit is contained in:
@ -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 © 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);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -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>
|
Reference in New Issue
Block a user