thedocks/caddy/site/links/index.js

28 lines
547 B
JavaScript

// app
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!',
json: null,
hits:0,
loaded: null
},
filters: {
pretty: function(value) {
return JSON.stringify(JSON.parse(value), null, 2);
}
},
methods:{
load() {
this.loaded = new Date()
this.hits += 1
fetch("links.json")
.then(response => response.json())
.then(data => (this.json = data));
}
},
mounted () {
this.load()
}
});