thedocks/caddy/site/links/index.js

26 lines
489 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',
data: {
message: 'Hello Vue!',
json: null,
hits:0
},
filters: {
pretty: function(value) {
return JSON.stringify(JSON.parse(value), null, 2);
}
},
methods:{
2021-12-25 22:39:07 +00:00
load() {
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())
.then(data => (this.json = data));
}
},
mounted () {
this.load()
}
});