Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data() {
- return {
- news: [],
- index: 0
- };
- },
- created() {
- setInterval(() => {
- this.index++;
- let n={};
- n.title="News "+this.index;
- n.url="https://myapi.co/news/"+this.index;
- this.news.push(n)
- }, 4000);
- },
- mounted() {
- axios.get('https://myapi.co/news/')
- .then(response => {
- this.news = response.data.data
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement