thedocks/caddy/site/links/index.js

28 lines
540 B
JavaScript
Raw Normal View History

2022-01-06 16:54:13 +00:00
// app
2021-12-25 22:28:59 +00:00
var app = new Vue({
el: '#app',
2022-01-07 22:11:08 +00:00
vuetify: new Vuetify(),
2021-12-25 22:28:59 +00:00
data: {
message: 'Hello Vue!',
2022-01-07 22:00:50 +00:00
links: null,
2022-01-07 20:48:31 +00:00
hits:0,
2022-01-08 11:16:31 +00:00
loaded: null,
target: "srv",
targets: ["srv","top","new"]
2021-12-25 22:28:59 +00:00
},
2022-01-07 21:59:21 +00:00
2021-12-25 22:28:59 +00:00
methods:{
2021-12-25 22:39:07 +00:00
load() {
2022-01-07 20:48:31 +00:00
this.loaded = new Date()
2021-12-25 22:28:59 +00:00
this.hits += 1
2021-12-26 15:18:28 +00:00
fetch("links.json")
2021-12-25 22:28:59 +00:00
.then(response => response.json())
2022-01-07 21:59:21 +00:00
.then(data => (this.links = data));
2021-12-25 22:28:59 +00:00
}
},
mounted () {
this.load()
}
});