Created
          April 17, 2020 07:29 
        
      - 
      
- 
        Save blogcacanid/b81438221dbcd52876296be3626c0013 to your computer and use it in GitHub Desktop. 
     dunia.js Covid-19 Vue.js - Dunia
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const url = "https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC,ETH&tsyms=USD,EUR"; | |
| const url_sumConfirmed = "https://api.kawalcorona.com/positif/"; | |
| const url_sumRecovered = "https://api.kawalcorona.com/sembuh/"; | |
| const url_sumDeaths = "https://api.kawalcorona.com/meninggal/"; | |
| const url_details = "https://api.kawalcorona.com/"; | |
| const vm = new Vue({ | |
| el: '#app', | |
| data: { | |
| results: [], | |
| sumConfirmed: [], | |
| sumRecovered: [], | |
| sumDeaths: [], | |
| details: [] | |
| }, | |
| mounted() { | |
| axios.get(url).then(response => { | |
| this.results = response.data | |
| }), | |
| axios.get(url_sumConfirmed).then(response => { | |
| this.sumConfirmed = response.data | |
| }), | |
| axios.get(url_sumRecovered).then(response => { | |
| this.sumRecovered = response.data | |
| }), | |
| axios.get(url_sumDeaths).then(response => { | |
| this.sumDeaths = response.data | |
| }), | |
| axios.get(url_details).then(response => { | |
| this.details = response.data | |
| }) | |
| } | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment