fixes
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<div>
|
||||
{{json}}
|
||||
<table>
|
||||
<tr v-for="(row,rowKey) in json" :key="rowKey">
|
||||
<td v-for="(value,key) in row" :key="key">{{value}}</td>
|
||||
@ -21,20 +20,34 @@
|
||||
<script>
|
||||
export default {
|
||||
name: "App",
|
||||
data: {
|
||||
json: []
|
||||
data() {
|
||||
return {
|
||||
json: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
const self = this;
|
||||
fetch("?json")
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
this.json = json;
|
||||
console.log(this.json);
|
||||
});
|
||||
.then(json => (self.json = json));
|
||||
},
|
||||
watch: {
|
||||
json() {
|
||||
console.log(this.json);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import url("https://cdn.scode.ovh/bootstrapLight.css");
|
||||
|
||||
td {
|
||||
border: 1px solid green;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user