thedocks/caddy/site/links/index.js
2022-01-06 16:54:13 +00:00

26 lines
489 B
JavaScript

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