-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreleva_dati.html
55 lines (50 loc) · 1.41 KB
/
preleva_dati.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<script src="https://unpkg.com/[email protected]/dist/vue.global.prod.js"></script>
</head>
<body>
<h1>Test api</h1>
<div id="app">
<table>
<thead>
<tr>
<th>id</th>
<th>Cliente</th>
<th>Contratto</th>
<th>Anno</th>
</tr>
</thead>
<tbody>
<tr v-for="item in items" :key="item.id">
<td>{{ item.id }}</td>
<td>{{ item.cliente }}</td>
<td>{{ item.contratto }}</td>
<td>{{ item.anno }}</td>
</tr>
</tbody>
</table>
</div>
<script>
const app = Vue.createApp({
data() {
return {
items: [],
};
},
mounted() {
fetch('https://localhost:8000/api/')
.then(response => response.json())
.then(data => {
this.items = data;
})
.catch(error => console.error('Errore nel fetch dei dati:', error));
},
};
app.mount('#app');
</script>
</body>
</html>