26 lines
489 B
JavaScript
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()
|
|
}
|
|
});
|