thedocks/caddy/site/links/index.js

25 lines
455 B
JavaScript
Raw Normal View History

2022-01-06 16:54:13 +00:00
// app
2022-01-07 21:59:21 +00:00
Vue.use(Vuetify);
2021-12-25 22:28:59 +00:00
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!',
2022-01-07 22:00:50 +00:00
links: null,
2022-01-07 20:48:31 +00:00
hits:0,
loaded: null
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()
}
});