Add statics
This commit is contained in:
21
static/js/home.js
Normal file
21
static/js/home.js
Normal file
@ -0,0 +1,21 @@
|
||||
new Vue({
|
||||
el: '#app',
|
||||
delimiters: ['[[', ']]'],
|
||||
data: {
|
||||
news: []
|
||||
},
|
||||
mounted: function () {
|
||||
this.getNews();
|
||||
},
|
||||
methods: {
|
||||
getNews: function () {
|
||||
fetch('/api/v1/news/')
|
||||
.then(function(response) {
|
||||
return response.json();
|
||||
})
|
||||
.then((json) => {
|
||||
this.news = json;
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
6
static/js/vue.min.js
vendored
Normal file
6
static/js/vue.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user